Replot a matlab.graphics.chart
Ältere Kommentare anzeigen
I have a simple issue that I could use some help with. I am preparing a loop where each cycle saves a plot in a matlab.graphics.chart. A simple code example:
x=[2 4 6 8];
y=[10 20 30 40];
plot1=plot(x,y);
How do I re-plot "plot1"? Thanks
7 Kommentare
KSSV
am 6 Sep. 2017
Why you are worried of replotting? already you have data in hand..use plot again..
JB
am 6 Sep. 2017
José-Luis
am 6 Sep. 2017
plot(x,y)
You can issue the command as many times as you want.
Or do you mean to get x and y data from an existing plot?
You could also copy graphic objects, but that's a roundabout way to go about things if you do have the data.
JB
am 6 Sep. 2017
JB
am 6 Sep. 2017
José-Luis
am 6 Sep. 2017
When you say generate one plot and store it in a data array, how do you do that?
Please show some example code.
JB
am 6 Sep. 2017
Akzeptierte Antwort
Weitere Antworten (2)
plot1 is the axis handle. "re-plotting" means plotting on the same figure window with the new data.
for iCount = 1:5
x = iCount*[2 4 6 8];
y = iCount*[10 20 30 40];
h1 = figure(1); %h1 is figure handle
plot1=plot(x,y); %plot1 is axis handle
end
Kategorien
Mehr zu Creating, Deleting, and Querying Graphics Objects finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!