How to save figure as appears on the screen? with the same aspect ratio, and font size, etc. ?
3 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
回答(2 个)
thomas weldon
2018-6-21
编辑:Walter Roberson
2018-6-25
Try this:
fig=gcf;ax=fig.CurrentAxes;fig.Color='w';fig.OuterPosition=fig.InnerPosition;
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!