フィルターのクリア

How do use gplot as subplots in a for loop?

1 回表示 (過去 30 日間)
Brandon Lieberthal
Brandon Lieberthal 2019 年 2 月 22 日
コメント済み: Brandon Lieberthal 2019 年 2 月 22 日
Hello,
I'm am trying to produce a plot of 5 x 5 network graphs in a subplot formation. This is my Matlab code:
figure
hold on
for i = 1:25
[xdata,ydata,AdjMat] = makerandomnetwork();
subplot(5,5,i);
gplot(AdjMat,[xdata ydata],'k')
end
The problem is that all the other subplots are cleared whenever a new subplot is generated. Any advice?

採用された回答

Gani
Gani 2019 年 2 月 22 日
編集済み: Gani 2019 年 2 月 22 日
Put hold on inside the loop.
figure
for i = 1:25
[xdata,ydata,AdjMat] = makerandomnetwork();
subplot(5,5,i);
gplot(AdjMat,[xdata ydata],'k')
hold on
end
  1 件のコメント
Brandon Lieberthal
Brandon Lieberthal 2019 年 2 月 22 日
Never mind, I figured it out. The makerandomnetwork() function I was using had a "close all" hidden in it. Thanks for your help.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSubplots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by