Can I supress a flashing title bar when refreshing plots?

1 回表示 (過去 30 日間)
Dara Parsavand
Dara Parsavand 2012 年 2 月 15 日
コメント済み: Dara Parsavand 2017 年 3 月 21 日
I've looked at the doc page for figure properties and I don't see that this is possible, but perhaps it is. My question is probably OS specific (using Windows XP Pro now, will try this in Redhat as well): Can one move between different plot windows and refresh the plot, e.g.
figure(1), plot([1 2], [3 4]) figure(2), plot([5 6], [7 8])
and not have the title bars (the very top bar that says Figure 1 or 2) flash?
My application is trying replace the Simulink visualization tools (which in general are very unsatisfying) with S-function tokens that drive normal MATLAB plots. One issue though is that on every refresh the plot is flashing at you (which the Simulink version does not do). But in general, anyone who loops over a plotting line of code and wants to show an animated plot could benefit from controlling this behavior.
Thanks, Dara

採用された回答

Walter Roberson
Walter Roberson 2012 年 2 月 15 日
Maybe. If you set() the figure to visibility 'off', update the plot, and set the visibility 'on' then the updates flash less.
  1 件のコメント
Dara Parsavand
Dara Parsavand 2017 年 3 月 21 日
Walter, Thanks for your idea. I forgot about my question until reviewing all my posts (must have found another solution - Simulink plotting has been getting better too). I did try this code just for fun:
%%test_plot_animation.m
% run once - then separate the two plots on the screen, then run again.
figure(1), plot([1 2], [3 4])
figure(2), plot([1 1], [5 4])
for i = 1:100
figure(1), set(gcf, 'visible', 'off'), plot([1 2], [3 4+i/1000]), set(gcf, 'visible', 'on')
figure(2), plot([1 2], [5 4+i/1000])
pause(0.01)
end
It doesn't result in a difference between figure 1 and 2 that I can see, but perhaps if it was a more complicated plot, the duration of the title bar flash could be shorter and maybe I would see less flashing. This flash seems like something that would be nice to control better, but it isn't as big a deal to me anymore.

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by