PDA

查看完整版本 : 请教一个棘手的问题


waclin
2008-11-03, 18:44
我用plot输出曲线时候,只能在一个图中出现一条曲线。请问有么有办法在一张图中画出两条以上的曲线?领导要在一张图中画两条曲线进行对比,郁闷呀?请哪位高手指点一下,谢谢!

hippo613
2008-11-03, 20:16
用 hold on; 命令
例如: plot ('曲线1');
hold on;
plot('曲线2');

waclin
2008-11-08, 19:35
怎么两曲线之间有影印部分呢?麻烦你再指点一下,谢谢!我只要这两条曲线,不要影印的。

remnant
2008-11-08, 19:39
如果想在一个坐标系下画多个图:
方法1:plot( x1, y1, x2, y2, x3, y3 ... );
方法2:plot( x1, y1 ); hold 'all'; plot( x2, y2 ); .....
如果想在一个窗口的多个坐标系下画图:
subplot( 2, 2, 1 ); % 2x2 个坐标系中的第1个, 2x2是可变的,如subplot( 3, 2, 1 );
plot( x1, y1 );
subplot( 2, 2, 2 ); % 2x2 个坐标系中的第2个
plot( x2, y2 );
......