Save Axis Labels/Titles/Ticks for Iterative Plotting
Ältere Kommentare anzeigen
I have two different surfaces to plot, under mildly different model assumptions. I go through a lot of trouble modifying the axis ticks, labels, title etc for the first surface. The majority of these are the same for the second surface, only the title will be different. Unfortunately when I replot the second set of data, all my work has disappeared! I need to go through all the axis labels, ticks etc. a second time. Is there a way to save all that info for iterative plotting?
Thanks.
Akzeptierte Antwort
Weitere Antworten (1)
Fangjun Jiang
am 9 Okt. 2011
use hold on before the second plot. help hold
use copyobj()
Or maybe this is what you need. Note that changing the 'xdata','ydata' will automatically change the axis ticks and axle limit.
f1=figure(1);
p=plot(1:10);
title('first');
xlabel('x');
ylabel('y')
set(p,'xdata',1:100,'ydata',rand(100,1));
4 Kommentare
Dr. Seis
am 9 Okt. 2011
Won't that also hold the first surface? It sounds like this person would like to keep all the settings the same, just change the surface. Erez, is this right?
Fangjun Jiang
am 9 Okt. 2011
Good point. I think you are right. Then I think you need to use copyobj().
Fangjun Jiang
am 9 Okt. 2011
See updated answer to see if that provides a solution.
Erez
am 9 Okt. 2011
Kategorien
Mehr zu Axis Labels finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!