How can I save the subplot figure automatically without clicking the buttion 'save' by mouse.

23 ビュー (過去 30 日間)
wenhao yang
wenhao yang 2021 年 9 月 14 日
コメント済み: Image Analyst 2021 年 9 月 15 日
Here is a subplot including 6 parts. I wanna save it automatically. I can use commands:
set(gcf,'PaperUnits','centimeters');
set(gcf,'PaperPosition',[0 0 10 10]);
set(gca,'Position',[0.18 0.18 0.75 0.70]);
print(gcf,'-djpeg','-r600','E:\test.jpeg');
However, these commands can save only the last part in the figure, which is the parameters 'G'.
How can I save all the 6 parts and arrange the size of each figure and the whole domain ?

回答 (1 件)

Image Analyst
Image Analyst 2021 年 9 月 14 日
Did you try exportgraphics()?
  2 件のコメント
wenhao yang
wenhao yang 2021 年 9 月 15 日
編集済み: wenhao yang 2021 年 9 月 15 日
yeah I've tried it. But still the last part in the subplot was saved.
Image Analyst
Image Analyst 2021 年 9 月 15 日
Are you sure you told it the handle of the entire figure, gcf, instead of the handle of the current (last) axes, gca?
exportgraphics(gcf, fileName);
I just don't see how it would take only one of the axes on the figure if you told it the entire figure. Show me the entire lines of code where you set the filename and called exportgraphics(gcf, fileName).

サインインしてコメントする。

カテゴリ

Help Center および File ExchangePrinting and Saving についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by