フィルターのクリア

Can't set the current figure inside a function

1 回表示 (過去 30 日間)
Dima
Dima 2012 年 11 月 4 日
Hi. I have encountered the following problem: I use a GUI and in the Callback function create new figure, which, obviously, appears at the top of the previous one. However, I need to make the old figure to appear on top, but setting
set(0,'CurrentFigure',old_figure)
at the end of callback function does not work for some reason, i.e. new figure still appears on top (which is little inconvenient for my case). Any suggestions?

採用された回答

Walter Roberson
Walter Roberson 2012 年 11 月 4 日
figure(old_figure)
should raise it and make it current. Setting the current figure is, as best I recall, defined to not raise it.
  1 件のコメント
Dima
Dima 2012 年 11 月 4 日
Thanks a lot, this works)

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

その他の回答 (1 件)

Matt Fig
Matt Fig 2012 年 11 月 4 日
Try changing the order of the children of root.
figure
figure
pause(1)
% Now fig 2 is on top.
set(0,'children',flipud(get(0,'children')))
% Now fig 1 is on top.

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by