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'
properties of figure's children is set to 'normalized'
the appropriate child is shrunk rather than cropped.
The question is, why is the height of figure limited and what (property) rules that limit. It looks like I'm limitted to figure height of 9.94" (Dell Latitude E5500; Win7 enterpise, 32-bit; matlab 2011b; resolution 1400x900 px)
Edit
I tried this:
>> set(gcf,'position',[10 10 600 600]),get(gcf,'position')
ans =
10.0000 10.0000 28.3333 9.8750
>> set(gcf,'position',[0 0 600 600]),get(gcf,'position')
ans =
0 0 600 600
The figure obtained by export_fig
is in both cases 28.35" x 9.88" as measured in Adobe acrobat 9 Pro.
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).