简体   繁体   中英

matlab gui uiwait hide the new figure behind the current one

I have two figures. In figure 1 m file, I write run figure 2.m uiwait(figure1);

Then in figure 2, after some process, I write uiresume(figure1)

The thing is that after matlab run figure 2, the figure flashes and hide behind figure 1. I need to move figure 1 and then operate on figure 2 which is very inconvenient. Can anyone help me to fix this?

Use figure . Here's an example:

h1 = figure; %// create figure 1
plot(1:5, 'o');
h2 = figure; %// create figure 2
plot(ones(1,5), '*');

Now the first figure is behind the second. To bring the first figure forward (make it the current figure), use

figure(h1)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM