フィルターのクリア

How to get text that is dynamic on a graph?

7 ビュー (過去 30 日間)
Francisco Sanchez
Francisco Sanchez 2018 年 2 月 24 日
回答済み: Francisco Sanchez 2018 年 2 月 24 日
So I'd like to get a graph that changes as variables change. I have played with this test to try to get rotating text but for some reason, the graph does not open until after I pause or quite the while loop. Just curious if there is a better way to do what I'd like to do
axis([0 5 0 5]);
a =0;
while true
a =a +1
h=text(2.5,2.5,'Rotated text','rotation',a);
delete(h)
end

採用された回答

Guillaume
Guillaume 2018 年 2 月 24 日
In general figures do not update while code is running. To force an update while code is running use drawnow
axis([0 5 0 5]);
a =0;
while true
a =a +1
h=text(2.5,2.5,'Rotated text','rotation',a);
drawnow();
delete(h)
end

その他の回答 (1 件)

Francisco Sanchez
Francisco Sanchez 2018 年 2 月 24 日
Thanks! Works perfectly

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by