mutiplots in a single GUI figure

1 回表示 (過去 30 日間)
Oday Shahadh
Oday Shahadh 2021 年 2 月 14 日
回答済み: dpb 2021 年 2 月 14 日
Hi,
I have below to plot in a single GUI plot, but at each run I just got single plot, while I need to plot all the three sets of data, I added hold off close the old plots on each new run, thanks
plot((zi-D/2)*100,Brate);
hold off
plot((z1-D1/2)*100,Brate1);
hold off
plot((z2-D2/2)*100,Brate2);
hold off
grid on
h=line([-D*100,D*100],[1-UniTol,1-UniTol]);hold on
set(h,'LineWidth',2)
h=line([-D*100,D*100],[1+UniTol,1+UniTol]);hold on
set(h,'LineWidth',2)
  1 件のコメント
Walter Roberson
Walter Roberson 2021 年 2 月 14 日
"hold off" means that it is okay for MATLAB to throw away anything already plotted. You probably want "hold on" after the first plot.

サインインしてコメントする。

回答 (1 件)

dpb
dpb 2021 年 2 月 14 日
"...I need to plot all the three sets of data, I added hold off close the old plots on each new run..."
That's exactly the wrong thing...it's hold on you want to not overwrite each preceding plot with the next.
Reread the documentation for hold and look at example code there to get the actual effect.
hold on
plot((zi-D/2)*100,Brate);
plot((z1-D1/2)*100,Brate1);
plot((z2-D2/2)*100,Brate2);
grid on
yline(1-UniTol,'LineWidth',2)
yline(1+UniTol,'LineWidth',2)

カテゴリ

Help Center および File ExchangeDiscrete Data Plots についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by