matlab中[AX,H1,H2]=plotyy(t,[y1,y2],t,[y3,y4]),绘制4条曲线,怎么分别设置它们线型

问题描述:

matlab中[AX,H1,H2]=plotyy(t,[y1,y2],t,[y3,y4]),绘制4条曲线,怎么分别设置它们线型
比如虚线,实线等和颜色啊,

SpecifierLine Style- Solid line (default)-- Dashed line:Dotted line-.Dash-dot lineSpecifierColorr Redg Greenb Bluec Cyanm Magentay Yellowk Blackw White[A,H1,H2]=plotyy(t,[y1,y2],t,[y3,y4]);set(H1,'Lin...这样的话,y1和y2的线型和颜色是一样的,那怎么让他们不一样呢那你得把y1,y2分开来画利用hold onhold on[A,H1,H2]=plotyy(t(1:length(y1)),y1,t(end-length(y2)+1:end),y2);set(H1,'LineStyle','--','Color','g')set(H2,'LineStyle',':','Color','m')[B,H3,H4]=plotyy(t(1:length(y3)),y3,t(end-length(y4)+1:end),y4);set(H3,'LineStyle','--','Color','b')set(H4,'LineStyle',':','Color','k')