# Multiple Figure Window Order

41 ビュー (過去 30 日間)
Jennifer 2011 年 9 月 14 日
Hello all,
I'm looking for the ability to open new figures behind current figures. For example, if I have 20 figures to open then figure 1 would appear in front, and then figure 2 would plot behind figure 1 such that I could still view figure 1. Figure 3 would then plot behind figure 2 and so on. Is there a way to accomplish this?
trevor

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

### 回答 (7 件)

Mark Brandon 2011 年 9 月 14 日
Hi J. I use this rather nice function called cyclefigs written by Peter Acklam
Actually maybe you want sortfigs.
I have found many of his utils very very useful
They can be found here
Hope that works for you.

#### 2 件のコメント

Jennifer 2011 年 9 月 14 日
Not really what I'm looking for. Perhaps I should have been more descriptive. I'm looking at data channels in a relatively fast passed environment. I have to inspect each channel (sometimes upwards of 100) to decide to proceed. I'm already plotting 6 on each figure. What I want to do is have the first figure plot, and then the next figure plot behind it so I can inspect the first, then move onto the next. Right now I have to wait for each plot to finish before I can start my inspection process.
Mark Brandon 2011 年 9 月 14 日
Yup that is more complex. descriptive is always better to get a clearer answer, see below for example.

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

Jan 2011 年 9 月 14 日
You can create the set of figures at first and draw to them starting from the last one:
nFig = 16;
FigH = zeros(1, nFig);
for i = 1:nFig
FigH(i) = figure('NextPlot', 'add'); % NextPlot might be useful
end
for i = nFig:-1:1
AxesH = axes('Parent', FigH(i), 'NextPlot', 'add');
line(1:100, rand(10, 100), 'Parent', AxesH);
end
Now you see the diagram on the topmost figure, which has been created at last. The next diagram is on figure under it etc.

#### 0 件のコメント

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

Daniel Shub 2011 年 9 月 14 日
You can reverse the order by setting the "children" property of the root:
set(0, 'Children', flipud(get(0, 'Children')))
you might want to move the first item to the last item after every figure call:
figure;
x = get(0, 'Children');
set(0, 'Children', [x(2:end); x(1)])

#### 0 件のコメント

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

Jennifer 2011 年 9 月 14 日
The whole point of this is to view the first plot while the others are still plotting. Sometimes this process takes 30~40 seconds while I'm just waiting on it. The end goal is not to have the plots in a certain order, rather, it's to view the first plot while the rest are plotting, without them popping on top and blocking my view of plots it has already generated. I want to get started on the viewing process before the plotting of all figures has finished.

#### 1 件のコメント

Jan 2011 年 9 月 14 日
@Jennifer: Does my example help you? It demonstrates how to draw to figures in the background.

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

Daniel Shub 2011 年 9 月 14 日
What do you do with figure 1, when you move on to figure 2? Do you close it, minimize it or move it? If you close it, you can do the following.
figure('Visible', 'Off', 'CloseRequestFcn', 'set(gcf+1, ''Visible'', ''On''); delete(gcf-1);');
For the first figure you need to then do
set(1, 'Visible', 'On');

#### 1 件のコメント

Daniel Shub 2011 年 9 月 14 日
I think from your comments that you think this approach might work, but that you want to handle minimization. You can probably get this functionality from the underlying java object. I would suggest, however, you consider building a simple GUI with two figures. One figure contains N maximized axes with each axes having the data from a single channel. The visibility of theses axes could be controlled by the second figure that has a single slider. The slider position controls which channel axis is visible.

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

Jennifer 2011 年 9 月 14 日
could "CloseRequestFcn" be changed to a minimize listener? If so, that would be perfect.

#### 0 件のコメント

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

Jennifer 2011 年 9 月 14 日
In addition to that I can't seem to get your suggested code functioning. I think your syntax is off, I'll keep trying.

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

### Community Treasure Hunt

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

Start Hunting!

Translated by