I would really like to use a for loop to generate and name a bunch of plots that can then be recalled later. In my iimaginary world it would look something like:
for n=1:bazillion
myplots(n)=plot(Data(:,n));
end
Then later on, I can pull up plot number one million and whatever and do whatever I like to it. Change titles, axis, put it in a presentation, etc....
so the question is: Can "plot(Data)" be saved as a variable? How is this done?
Thanks

 Respuesta aceptada

Walter Roberson
Walter Roberson el 16 de En. de 2014

0 votos

Yes, what you would store using exactly that kind of call would be the lineseries() object that plot() returns.
Note that lineseries objects are embedded within axes and it is axes that have the titles and so on. Saving a complete axes is slightly more complex. Unfortunately I do not have time right at the moment to give the (short) code.

Más respuestas (1)

Azzi Abdelmalek
Azzi Abdelmalek el 16 de En. de 2014
Editada: Azzi Abdelmalek el 16 de En. de 2014

0 votos

for n=1:bazillion
plot(Data(:,n));
hgsave(gcf,sprintf('figure%d.fig',n))
end
Then use hgload to get your plots
hgload('figure1.fig')
%and so on

Categorías

Más información sobre 2-D and 3-D Plots en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 16 de En. de 2014

Editada:

el 16 de En. de 2014

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by