Random ordering of figure numbers
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Mike Garrity
le 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.
Réponses (1)
Christopher Ison
le 29 Sep 2015
1 commentaire
Jon
le 30 Sep 2015
How are you creating the figures? In a loop like this?
for i = 1:N
figure(i) = plot(whatever);
end
Voir également
Catégories
En savoir plus sur Printing and Saving dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!