グラフの一部の拡大図のみ保存したい
Afficher commentaires plus anciens
グラフの一部の拡大図をaxesのオプションで作成しました。拡大図のみを保存したいので、元のグラフを非表示にしたのですが、この状態で保存すると、拡大図の後ろに白い部分が存在してしまいます(添付画像)。作成した正方形の拡大図の部分のみを保存することは、可能でしょうか。

以下使用したコードです。
x = (1:2:9);
y = (1:2:9);
f = figure;
%ax1 = axes('Position',[0.1 0.1 0.7 0.7]);
ax2 = axes('Position',[0.2 0.2 0.4 0.4]);
%plot(ax1,x,y,'.r')
plot(ax2,x,y,'.r')
pbaspect([1 1 1])
%axis(ax1,[0 10 0 10])
axis(ax2,[0 4 0 4])
ax = gca;
ax.XTickLabel = [];
ay = gca;
ay.YTickLabel = [];
set(gca,'TickLength',[0 0])
rootname = 'image'; % 画像ファイル名
saveas(gca,['E:\image_edit\',rootname,'.png']);
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur グラフィックス パフォーマンス dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

