Random ordering of figure numbers
8 views (last 30 days)
Show older comments
When I installed R2015a, figure numbers were then generated in random order. I have a script that produces many graphs at once, then tiles them. I was astonished to find they would no longer display in the order executed. The figure numbers were correct but they did not arrange in numerical order when tiled. This never happened before. Any clues as to what's going on? Could it be the tiling function? I checked get(0, 'Children') and it lists the figures in reverse display order (first is last in the list). FWIW, when the tiling function is not used, figures stack on one another in numerical order.
3 Comments
Mike Garrity
on 29 Sep 2015
This is just a guess, but I suspect that the code you're using to do the tiling is using GCF. If you create a bunch of figures in a row without calling drawnow, then which one becomes GCF is up to the operating system. This was always a bit unpredictable, but with the new multithreaded graphics system which was introduced in R2014b it became rather more unpredictable.
For this sort of thing, it is probably better not to depend on the value of GCF. Instead, use the return value of the figure function. Or, as you've noticed, you can look at the children of the root object. Either of those should be more predictable.
Alternatively, you could try adding some calls to drawnow to your code to try and keep the threads more in synch, but I don't think that would be a very robust solution.
But, as I said, this is just a guess and I may be all wet.
Answers (1)
Christopher Ison
on 29 Sep 2015
1 Comment
Jon
on 30 Sep 2015
How are you creating the figures? In a loop like this?
for i = 1:N
figure(i) = plot(whatever);
end
See Also
Categories
Find more on Printing and Saving 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!