figureの複製方法について
33 次查看(过去 30 天)
显示 更早的评论
例えば,図1にsin(x)をプロットして,図2にsin(x)とcos(x)をプロットしたい場合,
f1 = figure;
plot(x,sin(x));
f2 = figure;
plot(x,sin(x));
plot(x,cos(x));
のようにするのではなく,
f1を作成してsin(x)をプロットした後に,新しくfigureウインドウをつくりそこにf1にプロットされたものを貼り付けてからcos(x)を上書きする
といったことは可能でしょうか.
何か方法があれば教えてください.
0 个评论
采纳的回答
Akira Agata
2019-12-4
copyobj関数が使えるかと思います。
以下は簡単なサンプルコードです。
x = linspace(0,4*pi);
figure
plot(x,sin(x))
ax = gca;
hFig = figure;
copyobj(ax,hFig) % Copy plot(s) in the previous figure
hold on
plot(x,cos(x))
更多回答(1 个)
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!