Stop Windows MATLAB adjusting figure's position and size

I am writing some MATLAB code to export some graphics, which is "large". I tested my code on Windows system and I found that the position and size of the figure were adjusted.
I looked up the Help Center and saw the note (figure properties) as follows.
The Windows operating system enforces a minimum window width and a maximum window size. If you specify a figure size outside of those limits, the displayed figure will conform to the limits instead of the size you specified.
I wonder if there is some approah can stop Windows from changing the figure or adjust the minimum window width and maximum window size on Windows MATLAB?
I also tried to modify the position and size back. But I noticed that Windows MATLAB will change it back when I use `exportgraphics` to save the figure.

댓글 수: 3

could you please share some code samples to reproduce the issue ?
Sure. Try to run the following code in the directory where the attached 'fig.mat' stays.
load('fig.mat');
exportgraphics(fig, 'fig.pdf', 'ContentType', 'vector');
You will see the output pdf on Windows is different from that on Linux or MacOS.
The reason is what I mentioned above, but I don't know how to prevent it.

Since the issue is not actually related to Matlab, have you tried looking for general Windows fora for advice on how to change these settings?

댓글을 달려면 로그인하십시오.

답변 (1개)

埃博拉酱
埃博拉酱 2025년 1월 21일
편집: 埃博拉酱 2025년 1월 21일
你试过print吗?我一般用print出图,基本没有遇到过尺寸限制问题。
print(load('fig.mat').fig,'fig.pdf','-dpdf');

카테고리

도움말 센터File Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

제품

릴리스

R2024a

질문:

2025년 1월 20일

편집:

2025년 1월 21일

Community Treasure Hunt

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

Start Hunting!

Translated by