Figure position changes after printing
3 次查看(过去 30 天)
显示 更早的评论
I am using R2025a and I have noticed some strange behavior with the size and position of a figure after printing. I create a figure using the call
f = figure('units','normalized','Position',[0.1 0.2 0.24 0.25])
and after the figure is generated I run the line
get(f,'Position')
The result after the get command is [0.1 0.2438 0.2002 0.2062], and not the intended value [0.1 0.2 0.24 0.25]. This is replicated exacly if I set the units and size in separate calls after using
set(f,'Units','normalized')
set(f,'Position',[0.1 0.2 0.24 0.25])
This behavior started with R2025a. I tested these same commands in R2024b and got a figure with the appropriate values in the Position property, and it was indeed bigger than the figure generated with R2025a when compared side by side. How can I make sure that when I generate a figure I get one with the Position values that I had previously set?
PD: I tried setting the properties WindowStyle to normal, Resize to off, and ToolBar and MenuBar to none, all resulted in the same resizing of the output.
3 个评论
Ronit
2025-7-25
After following the reproduction steps you provided, I could not reproduce the issue.
>> f = figure('units','normalized','Position',[0.1 0.2 0.24 0.25]);
>> get(f,'Position')
ans =
0.1000 0.2000 0.2400 0.2500
If you are still facing this, I would suggest you create a Technical Support Case: https://www.mathworks.com/support/contact_us.html
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Graphics Object Programming 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!