Can't set the current figure inside a function

2 views (last 30 days)
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
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?

Accepted Answer

Walter Roberson
Walter Roberson on 4 Nov 2012
should raise it and make it current. Setting the current figure is, as best I recall, defined to not raise it.

More Answers (1)

Matt Fig
Matt Fig on 4 Nov 2012
Try changing the order of the children of root.
% Now fig 2 is on top.
% Now fig 1 is on top.


Find more on Interactive Control and Callbacks in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!