How to set figure size in 2025a

Hi, all
I just upgrated matlab to 2025a today and i immediately notice one thing: how do we set figure size now???
I used to do something like
set(gcf, "units", "inches", "position", [0, 0, 6, 4])
and copy/paste it into ppt - i would have a figure with aspect ratio 6 inch wide by 4 inch tall
----
however, now it gives me a figure that is 6 inch wide but 4.33 inch tall.
I tried InnerPosition/OuterPosition/PaperPositoin, none of them worked.

4 Comments

dpb
dpb on 16 Jul 2025
Edited: dpb on 16 Jul 2025
Report as a bug. The new desktop and rendering seems to have broken a lot and <they also changed figures to be tabbed in a window>(*) that may have fouled up things. Sometimes "new and improved" is only "new and different", not necessarily better (at least until all the issues introduced are resolved).
(*) You might try
f = figure(WindowStyle="normal");
To create a figure window that is independent of other windows, specify the window style as "normal".
Or the other notes go on with
In addition, figures have a larger default size that changes based on the size of your monitor. To use the previous default figure size for a single figure, set its Position property using a position vector of the form [left bottom width height]. Setting the Position property undocks the figure from the figure container.
f = figure(Position=[100 100 560 420]);
To use the previous default initial figure size for all figures, including those in the figure container, set the default figure position of the graphics root object.
set(groot,DefaultFigurePosition=[100 100 560 420])
Whether these will then fix the differences if done in absolute units or not will have to find out by trial and error.
The above can be found by digging through all the links in the release notes from the above top level link.
@Shengxiang, as dpb mentioned, please contact tech support and include instructions how to reproduce the problem.
Please include what operating system you're using and whether you are using display zoom on your monitor. Also, let us know how you're copying the figure.
Thank you so much, Adam and dqb. The operating system i am using is windows 11 Enterprise (23H2). I will contact tech support reporting it as bug.
"...let us know how you're copying the figure. "
He didn't add that detail in the comment above, but I'm guessing from the way the description was written he's been doing it by keyboard Ctrl-C/Ctrl-V, not via code. Of course, one would hope the code would produce same results...

Sign in to comment.

Answers (1)

Adam Danz
Adam Danz on 16 Jul 2025
Edited: Adam Danz on 16 Jul 2025
Thanks for mentioning this. It's being looked into.
In the meantime, exportgraphics and copygraphics have new (R2025a) properties to specify the width and height of the exported image that may be helpful for the workflow you described.

Categories

Find more on Creating, Deleting, and Querying Graphics Objects in Help Center and File Exchange

Products

Release

R2025a

Tags

Asked:

on 16 Jul 2025

Commented:

dpb
on 16 Jul 2025

Community Treasure Hunt

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

Start Hunting!