Plot on different figures during a loop
1.207 views (last 30 days)
I'm extracting from different files some data that have ot plot on the same plot, I use a loop like
figure, hold on
I'd like to plot t(:,1),t(:,2) on figure 1, and for example t(:,1),t(:,3) on another figure. Is it possible to do it in the same loop?
thanks for your help
the cyclist on 28 Jul 2011
Yes. When you call the figure() command, call it with an input argument:
Then, before you do the particular plotting command, call figure() again, using the input argument that you want to plot to:
When the figure number already exists, it makes that figure current.
You might want to read "doc figure", "doc gcf", and "doc hold" to make sure you don't overwrite the plot that is already there in that figure.
More Answers (2)
Kehinde OROLU on 28 Jul 2011
Use this instead: