How to generate the figure of subplot with consistent size?

I would like to know how to generate the figure of subplot with consistent size. This is becuase after I generate the figures of subplot from different computers (different computers have different monitor and resolution) and save them, the size of subplot in different figures appears to be different.
I think that there is command to control the size to be consistent so that I can save figures of subplot with consistent size no matter different computer is used to generate and save the figures, but I do not know that command. Does anyone know about that?
Thanks for your kind attention...

回答 (2 件)

nanren888
nanren888 2012 年 1 月 28 日

0 投票

Look for position properties in the figures. You can get & set them with the figure & axis handles.

2 件のコメント

Frank Lau
Frank Lau 2012 年 1 月 28 日
But how about if I use some command to do so?
Because if I generate many figures, then each time I need to get & set them with the figure & axis handles and it would take a long time to do that.
Jan
Jan 2012 年 1 月 28 日
@Frank Lau: But "get" and "set" *are* commands.
You can set the size, papersize and paperposition of the figure programmatically (see "doc figure"). If the figure has a well defined size, the subplots have also.

サインインしてコメントする。

Daniel Shub
Daniel Shub 2012 年 1 月 28 日

0 投票

Before running your code, right when you start MATLAB, or added to your startup.m
x = get(0, 'DefaultFigurePosition');
set(0, 'DefaultFigurePosition', [x(1:2), 800, 600]);

3 件のコメント

Frank Lau
Frank Lau 2012 年 2 月 7 日
The above commands still don't work properly. I have generated the figures from the same code by using different computer with different resolution. I still found that there are differences in the size of subplot of the figures.
When looking at properties of each subplot in two figures, I found that there are differences in the 'Outerposition' and 'Position'. I guess that some commands are needed so that 'Outerposition' and 'Position' are the same even the figures are generated from different computers. But what commands should I use in this case?
Daniel Shub
Daniel Shub 2012 年 2 月 7 日
Are you comparing on screen size? Are you figures identical (same axis limits and labels)?
Frank Lau
Frank Lau 2012 年 2 月 8 日
The axis limits and labels are the same. But the size of each subplot is different when comparing two figures generated from different computers

サインインしてコメントする。

タグ

質問済み:

2012 年 1 月 28 日

編集済み:

2013 年 10 月 4 日

Community Treasure Hunt

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

Start Hunting!

Translated by