Replot a matlab.graphics.chart
이전 댓글 표시
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
KSSV
2017년 9월 6일
Why you are worried of replotting? already you have data in hand..use plot again..
JB
2017년 9월 6일
José-Luis
2017년 9월 6일
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
2017년 9월 6일
JB
2017년 9월 6일
José-Luis
2017년 9월 6일
When you say generate one plot and store it in a data array, how do you do that?
Please show some example code.
JB
2017년 9월 6일
채택된 답변
추가 답변 (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
카테고리
도움말 센터 및 File Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!