MATLAB: Does set(0, ‘Children’, foo) not stack figure windows correctly in MATLAB 7.0.0 (R14)

childrenfigurehandlesMATLABoforderpropertystackingwindows

The documentation clearly states that "You can change the order of the handles in the children property of the root and thereby change the stacking order of the figures on the display".
To reproduce this issue the following commands:
figure('Position', [100 200 560 420])
figure('Position', [200 240 560 420])
figure('Position', [300 280 560 420])
On screen figure 3 is on top of 2 which is on top of 1. This is correctly indicated by the "Children" property of the "root" (0).
get(0, 'Children')
ans =
3
2
1
Now try reversing the figure stacking order.
set(0, 'Children', [1 2 3]')
At this point figure 1 should be on top of figure 2 which in turn should
be on top of figure 3. However, this is not the case; figure 2 is
on top of figure 1 which is on top of figure 3.

Best Answer

This bug was fixed in MATLAB 7.1 (R14SP3). If you are using a previous version please read the following:
There is a bug in MATLAB 7.0.0 (R14), 7.0.1 (R14SP1) and 7.0.4 (R14SP2) that causes the figures to be stacked in the incorrect order. To work around this issue, you can use the FIGURE command to stack the figures appropriately.
figure('Position', [100 200 560 420])
figure('Position', [200 240 560 420])
figure('Position', [300 280 560 420])
ch = get(0,'children')
figure(ch(3))
figure(ch(2))
figure(ch(1))