Monday, October 20, 2008

Exporting / Printing of figures in MATLAB: solve problems with boundaries

It took me a while to figure out that if you want to save figures in MATLAB from your script or the command line, you need to use the print command.

I was using the -depsc2 output flag to generate an EPS file. However, boundaries kept getting messed up.

The fix that worked for me, right before your print command:

This makes sure what you see on screen and on file are consistent.