There are many similar questions regarding this, and in the past they have helped me to get what I want, however it seems that changing in changing to Matlab 2015 things aren't working the same any more.
I want to export figures from Matlab as .eps with a size of 4 x 3 inches so they will fit what I'm doing on Latex. Even though .eps is a vector format and would scale fine, I want to make sure the font sizes on figures are correct so it is important that it's size is set properly. The usual advice is to set the figure properties as so:
set(gcf, 'PaperUnits', 'inches', 'PaperPosition', [0 0 4 3], 'PaperPositionMode', 'auto');
Doing this does not set my .eps to 4 x 3 inches, it seems to scale the page to the figure, not the figure to the page. If instead I do not set PaperPositionMode as auto, the page does export at 4 x 3 inches, however the figure is far too big and is cropped. Whatever PaperPosition (size) I specify, the figure itself does not scale to the page.
Why is PaperPositionMode 'auto' ignoring my specified paper size? How can I specify the figure size as opposed to the paper size?
Using Matlab R2015a on Arch Linux. Below is the code I'm using.
FNO = load('data/forced_no_oil'); % forced no oil
FWO = load('data/forced_with_oil'); % forced with oi
fig1 = figure;
plFNO = plot(FNO(:,1),FNO(:,2),'x');
hold on
plFWO = plot(FWO(:,1),FWO(:,2),'x');
xl1 = xlabel('Frequency (Hz)');
yl1 = ylabel('Displacement Amplitude');
legend('Forced Without Oil','Forced With Oil')
set(fig1, 'PaperUnits', 'inches', 'PaperPosition', [0 0 8 6], 'PaperPositionMode', 'auto');
print('-depsc','../latex/images/frequencyDisplacement.pdf')