MATLAB: EPS export problems in R2014b

command lineeditorepsexportgraphicsMATLABprintprintingr2014bsize;

I have recently upgraded to R2014b (Linux version), and now exporting figures to eps seems to have a strange bug. If I try the following from the command line, I get the expected outcome. plot(1:3,2:4);print(gcf,'-depsc', 'testFromCommandLine.eps');
However, if I run the exact same script from the editor window, I get an eps file with a graph that occupies the top left corner of the canvas.
The only code in the script is: close all; plot(1:3,2:4); print(gcf,'-depsc', 'testFromScript.eps')
The screenshots of the two generated eps files are embedded.
This happens in all these three cases: pressing the RUN button in the editor, selecting the code and running the selection and executing the script (just typing the script's name without .m) from the command line.

Best Answer

Can you check the 'PaperPositionMode' property of the figure before printing it in each case? Try setting it to 'auto' before printing:
>> set(gcf, 'PaperPositionMode','auto')
Do you see the same behavior when printing to something else than .eps, for example .png?
>> print -dpng test.png