How to generate the figure of subplot with same size from different computers?

3 views (last 30 days)
I would like to know how to generate the figure of subplot with consistent size, say 4 x 2 subplot. This is because 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.
Acutually, following the suggestions in http://www.mathworks.com/matlabcentral/answers/27305-how-to-generate-the-figure-of-subplot-with-consistent-size. I tried to use the following commands
x = get(0, 'DefaultFigurePosition'); set(0, 'DefaultFigurePosition', [x(1:2), 800, 600]);
However, it doesn't work as the size of subplot in different figures (generated from different computer and each figure has 4 x 2 subplot) still appears to be different. 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?
Thanks for your kind attention...

Answers (2)

Jan
Jan on 11 Feb 2012
How do you compare the positions of the subplots? Perhaps the problem is not caused by really different positions, but by a invalid measurement method.
Do you use the same font sizes and what does
get(0, 'ScreenPixelsPerInch')
reply on the different computers?
  2 Comments
Frank Lau
Frank Lau on 13 Feb 2012
Both computers get
get(0, 'ScreenPixelsPerInch')
ans =
96
and same font size is used.
Jan
Jan on 16 Feb 2012
I cannot reproduce the problem. I get exactly the same positions for subplots as long the figures have the same size and units, and the DefaultAxesPosition has not been modified.
Do you find any other parameters, which influence the subplot-positions, when you look into the source of the SUBPLOT function?

Sign in to comment.


Frank Lau
Frank Lau on 16 Feb 2012
Can anyone know how to solve the problem?
  4 Comments
Frank Lau
Frank Lau on 17 Feb 2012
@Walter and Jan: As well as equal position, I also need the subplot of two different figures has equal size.
Walter Roberson
Walter Roberson on 17 Feb 2012
That cannot be done on real-world displays without expensive calibration equipment that is run every time the display shakes or is touched or turned on or off. Even then there is no promise it can be done.
The display I am using right now is 1280 x 1024, which is a 5:4 aspect ratio. It is not uncommon for displays to run at 960 x 800, which is 6:5, or at 1024 x 768, which is 4:3. You can work out the LCD (Lowest Common Denominator) of those ratios: it is 60 for both the top and bottom. So 12 x 15 pixels on the first is equivalent ratio of 10 x 12 pixels of the second, which is equivalent of the second, which is equivalent of 15 x 20 of the third. These are the elementary box sizes that you have to work with: any item that most be positioned more finely than one of these boxes *cannot* be positioned properly in at least one of the resolutions, and likewise any item that is larger than one of these boxes can only be positioned properly on the other resolutions if it is a multiple of these sizes. If you have a 12 x 15 pixel box on the first, you need to allocate 15 x 20 on the third in order to maintain the same aspect ratio.
But this analysis only covers the case where those pixels are evenly spaced -- i.e., equal screen sizes. If the screen sizes are different (as is the case between different models of even the same manufacturer) then you need to do notably more complicated complications.
And if there is a horizontal or vertical width adjustment such as there are on CRT, or if there are electronic equivalents for LCD, you need to calibrate calibrate calibrate to be sure everything is square... involving an absolute minimum of 2 hours of running before calibration to allow thermal equilibrium (more conservative recommendations are for at least 12 hours for thermal equilibrium.)
LCD bezels in laptops tend to have stress along the edges that bend the LCD pane which leads to uneven pixel distribution in odd ways.
If you are not involved in a MIL-spec project that demands pixel-level size consistency, then my recommendation would be to give up on this requirement. And if you *are* involved in a MIL-spec project then insist on uniform equipment, as you are not going to be able to meet the performance specification otherwise.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!