Can figure numbers be re-assigned?
42 views (last 30 days)
Is it possible to re-assign a figure number , for example if I have a Figure 55 open, can I make it Figure 2 as long as I don't already have a Figure 2 open? If so how do I do this?
I have a routine that generates 60+ figures, and I delete all but 3 interesting ones. I would like to make them Figures 1,2,3 because I need to re-run the routine and generate another set of figures, and I'd like the first set to appear together in the figure order (it makes them easier to keep track of).
José-Luis on 9 Jun 2014
Edited: José-Luis on 9 Jun 2014
To get a list of all the existing figures:
If figure two does not exist and you want to copy figure(55):
Get rid of figure(55):
And to answer your question directly. I believe once a figure number is set, you have to live with it. But there are workarounds, such as the one above.
More Answers (1)
Joseph Cheng on 9 Jun 2014
Edited: Joseph Cheng on 9 Jun 2014
This maybe a bit hard to implemented based on how you're selecting the 3 interesting ones but the function copyobj() will do the trick.
x = randi(10,1,5);
h1 = figure(1),plot(x);
h2 = gcf;
Here i create a random plot in figure 1. and then using gcf i get figure 100 and copy figure 1 to figure 100.