【绘图】双坐标轴如何画

版权声明:本文为博主原创文章,未经博主允许不得转载。保留追究法律责任,转载联系博主。交流欢迎加QQ群463339221。 https://blog.csdn.net/m0_37362454/article/details/81943367

x=[5 6 7 8 9 ];

y1=[5.39 5.12 4.91 4.73 4.68  ];

y2=[5.03 4.85 4.59 4.49 4.47 ];

plot(x, y1, 'r-o',x, y2, 'b-s')

legend('A''B');

hold on

[a1,h1,h2]=plotyy(x, y1,x, y2);

set(h1,'LineStyle','-o','Color','r');%设置右侧线型

set(h2,'LineStyle','-s','Color','b');%设置左侧线型

hold off

xlim auto

扫描二维码关注公众号,回复: 2967202 查看本文章

猜你喜欢

转载自blog.csdn.net/m0_37362454/article/details/81943367