Plotting multiple graphs in one figure
2 ビュー (過去 30 日間)
古いコメントを表示
I want to put 3 curves in one graph but i couldn't use the hold on function because for each curve i run several times to get the values i want so any idea how to do it without the hold on function??
3 件のコメント
Walter Roberson
2011 年 5 月 27 日
Please show the structure of your code. It is not clear why "hold on" would not work for you.
回答 (4 件)
Jan
2011 年 5 月 27 日
If you want to avoid "hold on" for any reasons (which I cannot understand), try this initially:
axes('NextPlot', 'add')
0 件のコメント
Samer Husam
2012 年 8 月 30 日
try this:
curve 1: x1,y1
curve 2: x2,y2
curve 3: x3,y3
figure (1)
plot(x1,y1,x2,y2,x3,y3)
0 件のコメント
Igor
2011 年 5 月 27 日
maybe
plot(gca,x1,y1)
plot(gca,x2,y2)
1 件のコメント
Walter Roberson
2011 年 5 月 27 日
Igor, under the default settings, the second plot would overwrite the first. Using "hold" or setting NextPlot are necessary to prevent that.
Walter Roberson
2011 年 5 月 27 日
If you are not specifically creating a new figure each time, then you could switch to using line() instead of plot()
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!