Stop Windows MATLAB adjusting figure's position and size

31 ビュー (過去 30 日間)
Cunxin
Cunxin 2025 年 1 月 20 日
編集済み: 埃博拉酱 2025 年 1 月 21 日 13:23
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 件のコメント
Cunxin
Cunxin 2025 年 1 月 20 日
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.
Rik
Rik 2025 年 1 月 21 日 7:34

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 日 13:12
編集済み: 埃博拉酱 2025 年 1 月 21 日 13:23
你试过print吗?我一般用print出图,基本没有遇到过尺寸限制问题。
print(load('fig.mat').fig,'fig.pdf','-dpdf');

カテゴリ

Help Center および File ExchangePrinting and Saving についてさらに検索

製品


リリース

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by