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 Comments

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?

Sign in to comment.

Answers (1)

你试过print吗?我一般用print出图,基本没有遇到过尺寸限制问题。
print(load('fig.mat').fig,'fig.pdf','-dpdf');

Categories

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

Products

Release

R2024a

Asked:

on 20 Jan 2025

Edited:

on 21 Jan 2025

Community Treasure Hunt

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

Start Hunting!