Matlab 双纵轴坐标系——plotyy

双纵轴坐标系plotyy代码示例

1.调用plotyy

x=linspace(0.1,0.2,21);      % x轴数据
phase_temp=phase-min(phase);
fig=figure;
[Ax,line1,line2]=plotyy(x,phase_temp,x,T);			% phase_temp维度:21x1;T维度:21x1,均与x相同

2.label设置

ylabel(Ax(1),"phase(rad)","Color","r",'FontName','Times New Roman','FontSize',20);          % label设置
ylabel(Ax(2),"Transmission","Color","b",'FontName','Times New Roman','FontSize',20);
xlabel("radius(um)",'FontName','Times New Roman','FontSize',20);

3.坐标轴设置

set(Ax(1),'Ycolor','r','FontName','Times New Roman','FontSize',20);          % 坐标轴颜色与字体设置
set(Ax(2),'Ycolor','b','FontName','Times New Roman','FontSize',20);

set(Ax(1),'ylim',[0,6.28]);             % 坐标轴刻度与范围设置
set(Ax(2),'ylim',[0,1.2],'ytick',[0:0.2:1.2]);       

4.曲线参数设置

set(line1,'linestyle',"-",'color','r',"Linewidth",3);               
set(line2,'linestyle',"-",'color','b',"Linewidth",3);     

5.legend设置

legend('Phase','Reflectance','FontName','Times New Roman','FontSize',20,'Location','northeast',"Box","off");        % legend设置  

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值