figureのposition領域(プロット範囲)のみの保存方法
28 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
NAKAI TAKUYA
el 18 de Jul. de 2018
Comentada: NAKAI TAKUYA
el 18 de Jul. de 2018
上記ページで青枠で囲まれたプロット範囲(position領域)のみを.figまたはjpgで保存したいのですが、方法を教えていただきたく思います。
Respuesta aceptada
michio
el 18 de Jul. de 2018
「余白を最小限にした Figure の保存」 の最後のサンプルコード部分が参考になるかと思います。
この時に、
axes = gca;
axes.Position = [0,0,1,1];
上記コマンドで axes オブジェクトの Position プロパティを Figure 全体を占めるようにしておけば、ご所望のファイル出力になるかと思います。ご確認いただけますでしょうか。
fig = gcf;
plot(rand(10,2))
axes = gca;
axes.Position = [0,0,1,1];
fig.PaperPositionMode = 'auto'
fig_pos = fig.PaperPosition;
fig.PaperSize = [fig_pos(3) fig_pos(4)];
% ファイル形式での Figure の保存
% Figure をファイルに保存します。
print(fig,'MySavedFile','-djpeg')
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!