During the answering this question and issues, unrelated to the question, with creating figures with really high height I\'ve found that figures are cropped. If \'units\'<
I suspect it has to do with with the maximum display size detected by Matlab and the pixel density of your system.
On my Matlab R2013a, Windows 7, with a screen 1900x1200, I can get a bigger figure than you, but it will still be truncated:
%% // MATLAB R2013A - Windows 7, 1900x1200pixels
set(gcf,'units','inches','position',[1 -5 6 15])
get(gcf,'position')
get(gcf,'OuterPosition')
returns:
ans =
1.00 -5.00 6.00 11.81
ans =
0.92 -5.08 6.17 12.71
My maximum vertical figure size was cut at 11.81
inches. Now that is the inside of a Matlab figure. The real size including the title bar and borders is given by the property OuterPosition
.
Now consider:
>> get(0,'ScreenSize')
ans =
1.00 1.00 1920.00 1200.00
>> get(0,'ScreenPixelsPerInch')
ans =
96.00
If we do 1200pixel/96ppi=12.5. With this screen density, Matlab can only display 12.5 inches worth of graphics. This will be even mode obvious if you set the unit to 'Pixels':
set(gcf,'units','inches','position',[1 -5 6 15])
set(gcf,'units','Pixels')
get(gcf,'position')
get(gcf,'OuterPosition')
ans =
97.00 -479.00 576.00 1134.00
ans =
89.00 -487.00 592.00 1220.00
The figure was truncated at exactly 1220pixels (the inches unit is just a conversion, Matlab base unit will work in pixels). I suspect the extra 20 pixels allowed are an extra allowance for the title bar.
Now with your numbers, I do not have the outerposition
of your figure, but even the figure inner position does match roughly your screen dimension (900px*96ppi=9.375inches). Try to force the units back to Pixels
, get the OuterPosition
of the figure and I wouldn't be surprised if you get 920pixels.
Now it seems you only need to worry about that for older versions of Matlab. On the same machine (Win 7, 1900x1200px), with Matlab R2015b, no more automatic cropping:
%% // MATLAB R2015B - Windows 7, 1900x1200pixels
set(gcf,'units','inches','position',[1 -5 6 15])
get(gcf,'position')
get(gcf,'OuterPosition')
ans =
1.00 -5.00 6.00 15.00
ans =
0.92 -5.08 6.17 15.40
set(gcf,'units','Pixels')
get(gcf,'position')
get(gcf,'OuterPosition')
ans =
97.00 -479.00 576.00 1440.00
ans =
89.00 -487.00 592.00 1478.00
The new graphic engine of Matlab seem to have lifted that restriction, my figure is now bigger that my screen size (whether you look at pixels or inches).