figureの複製方法について
35 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
例えば,図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 Commenti
Risposta accettata
Akira Agata
il 4 Dic 2019
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))
Più risposte (1)
Vedere anche
Categorie
Scopri di più su 2 次元および 3 次元プロット in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!