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!
