本文主要是介绍matlab画两个纵坐标的图,Matlab plotyy画2个纵坐标不同的图,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
Matlab plotyy画2个纵坐标不同的图
Matlab plotyy画2个纵坐标不同的图
PS:注意:AX返回的是两个坐标轴的句柄,而H1和H2则是表示的每个图像的句柄。
figure;
t=0:1:9*pi;
[H,Ha,Hb]=plotyy(t,sin(t),t,exp(t));
d1=get(H(1),'ylabel');
set(d1,'string','yayacpf');
d2=get(H(2),'ylabel');
set(d2,'string','bbs from hit','fontsize',18);
[var1]
t=0:0.1:9;
[ax,h1,h2]=plotyy(t,sin(t),t,cos(t));
set(h1,'linestyle','-','marker','o','color','r');
set(h2,'linestyle',':','marker','x','color','b');
[var1]
x=linspace(0,2*pi,50);
[ax,h1,h2]=plotyy(x,sin(x)+cos(x),x,exp(x));
set(h1,'linestyle','-')
set(h2,'linestyle','-')
set(h1,'marker','o')
set(h2,'marker','+')
hold on
x=linspace(0,2*pi,50);
hh=line(x,cos(x));
set(hh,'linestyle','-')
set(hh,'marker','s')
hold on
hhf=line(x,sin(x));
set(hhf,'color','r')
set(hhf,'linestyle','-')
set(hhf,'marker','*')
legend([h1,h2,hh,hhf],'sin(x)+cos(x)','exp(x)','cos(x)','sin(x)'); %加注图例
参考链接:https://blog.csdn.net/qq_25018077/article/details/88395445
Matlab plotyy画2个纵坐标不同的图相关教程
这篇关于matlab画两个纵坐标的图,Matlab plotyy画2个纵坐标不同的图的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!