How to save figure as appears on the screen? with the same aspect ratio, and font size, etc. ?

3 ビュー (過去 30 日間)
Mr M.
Mr M. 2016 年 6 月 3 日
編集済み: Walter Roberson 2018 年 6 月 25 日
figure('units','normalized','outerposition',[0 0 .5 1]);
hist(rand(100));
saveas(gcf,sprintf('%s.png',mfilename));
For example in this case the output png is not a portrait format, however the figure window is.

回答 (2 件)

Image Analyst
Image Analyst 2016 年 6 月 3 日

thomas weldon
thomas weldon 2018 年 6 月 21 日
編集済み: Walter Roberson 2018 年 6 月 25 日
Try this:
fig=gcf;ax=fig.CurrentAxes;fig.Color='w';fig.OuterPosition=fig.InnerPosition;

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by