When I save a figure to a file (saveas , hgexport) the figure is re-sized. How do I save a figure to a file that is identical to the screen figure (i.e. not resized)? Why isn't this the default for saving figures?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
David
am 20 Jul. 2015
Beantwortet: Allen Goldstein
am 21 Jan. 2021
I have changed the figure size using:
figure('OuterPosition',[1 1 scrsz(3)/1.1 scrsz(4)/1.1]);
When I attempt to save the figure to a file (png, bmp, jpg) using saveas or hgexport, the figure size is resized back to default. How do I avoid this?
Using the figure window menu bar and edit>copy figure copies the screen figure to the clipboard without re-sizing. Why isn't this easy to do with Matlab commands?
1 Kommentar
Akzeptierte Antwort
Walter Roberson
am 20 Jul. 2015
You probably need to look at the figure PrintPosition and PrintPositionMode properties.
Weitere Antworten (1)
Allen Goldstein
am 21 Jan. 2021
You need to change the Resolution in the factorystyle to 0:
style = hgexport('factorystyle'); % get the style
style.Resolution = 0; % Resolution = 0 meanst use the screen resolution
hgexport(data,'-clipboard',style);
0 Kommentare
Siehe auch
Kategorien
Mehr zu Printing and Saving finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!