.fig file places saved figure in a different position than that originally specified
35 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Clay Fulcher
am 5 Dez. 2025 um 2:33
Kommentiert: Clay Fulcher
am 5 Dez. 2025 um 20:46
I create a figure and set it's position using set(gcf,'position'...), and then use savefig to save the figure in a file. When I then double-click on the .fig file, it comes up in a position different than the one originally specified. Is there a way to keep the figure position intact in the saved .fig file?
7 Kommentare
Akzeptierte Antwort
Benjamin Kraus
am 5 Dez. 2025 um 19:50
Some questions:
- What release of MATLAB are you using?
- Do you see the same issue if you set the figure position to something much smaller?
- What is the output from get(groot,'MonitorPositions')
What I suspect may be happening is that MATLAB is trying to make sure your figure is not clipped by the edge of the screen, so it is shifting your figure to avoid hitting the edges of the screen.
Based on the position you specified, it seems like you may be trying to make the figure maximized. Can you use WindowState instead?
f = figure;
f.WindowState = "maximized";
Weitere Antworten (0)
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!