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

3 visualizzazioni (ultimi 30 giorni)
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.

Risposte (2)

Image Analyst
Image Analyst il 3 Giu 2016

thomas weldon
thomas weldon il 21 Giu 2018
Modificato: Walter Roberson il 25 Giu 2018
Try this:
fig=gcf;ax=fig.CurrentAxes;fig.Color='w';fig.OuterPosition=fig.InnerPosition;

Categorie

Scopri di più su Startup and Shutdown in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by