How to set specific size of a figure with exportgraphics?
81 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Louis Tomczyk
am 9 Jun. 2022
Kommentiert: Louis Tomczyk
am 10 Jun. 2022
Dear all,
I would like to save a figure with specific size with function.
I saw answers with but I would like to use the environment.
For example I would like to save with the following size:
(sorry guys, but it might be a good idea to stop using non SI units like inches of whatever ^_^)
How can I do it?
X = 0:10:10;
Y = X;
Title = "hello.png";
F = figure;
plot(X,Y)
exportgraphics(F,Title,'Resolution',600)
Thanks in advance,
Best regards,
louis
0 Kommentare
Akzeptierte Antwort
Richard Quist
am 9 Jun. 2022
@Louis Tomczyk: exportgraphics does not provide an option for specifying an output size. That feature has been requested and is being considered, but I don't have any timeline for when/if that will be implemented.
You may find using the print command as an alternative, where the output size can be controlled by setting the figure's PaperPosition property (see the Printing & Exporting section of the figure properties documentation)
I hope that helps.
Weitere Antworten (1)
James Tursa
am 9 Jun. 2022
This doesn't answer your question about controlling exported sizes, but you might be interested in the following export_fig FEX submission maintained by Yair Altman:
Siehe auch
Kategorien
Mehr zu Printing and Saving finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!