📄 plotyy.txt
字号:
clf;
dx=0.1;
x=0:dx:4;
y=x.*sin(x);
s=cumtrapz(y)*dx;
[AX,H1,H2]=plotyy(x,y,x,s);
set(get(AX(1),'Ylabel'),'String','Left Y-axis','color','k','linewidth',1.2)
set(get(AX(2),'Ylabel'),'String','Right Y-axis','color','r','linewidth',1.2)
set(H1,'LineStyle','--','color','k','linewidth',1.2)
set(H2,'LineStyle',':','color','r','linewidth',1.2)
x=linspace(0,2*pi,40);
[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,40);
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)',0);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -