Putting "hold on" or "hold off" before every plot.
古いコメントを表示
Is it good practice to put "hold on" or "hold off" before every plot? Or does it not matter?
2 件のコメント
Manisha Sonewane
2021 年 9 月 28 日
hold on plot(sample,mass1,"ks")
Walter Roberson
2021 年 9 月 28 日
At the time the question was asked, matlab did not support double-quoted literals such as "ks" and would have needed 'ks'
Anyhow, you do not seem to have commented on whether using "hold on" all the time is a good idea or not.
採用された回答
その他の回答 (1 件)
Jan
2015 年 9 月 22 日
I avoid the hold function usually, but create the axes object with the wanted behavior explicitly:
AxesH = axes('NextPlot', 'add');
plot(1:10, rand(1, 10), 'Parent', AxesH);
plot(1:10, rand(1, 10), 'Parent', AxesH);
Defining the Parent takes a small chunk of time during programming, but the program becomes more stable: If the user has the chance to click on an axes, the gca is affected and the next plot can appear in an unexpected location. Because I cannot prevent users from clicking around, I rely on defining the Parent und all conditions.
カテゴリ
ヘルプ センター および File Exchange で Interactive Control and Callbacks についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!