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!