12

I have a plot in Matlab needed to save the eps format. If I use the interactive menu in the figure to do so, everything is going all right, the exported eps is good. But if I use the following command

saveas(gca, 'myplot.eps','psc2');

But if I do in this way, the exported eps is not clipped and the margin is too big. How to save the eps without margin in the program? Thanks.

BTW, if I use the following code instead

saveas(gca, 'myplot.eps','eps');

then the output eps is clipped but it is black and white instead of color.

Compass
  • 5,502
  • 4
  • 27
  • 40
user1285419
  • 2,061
  • 7
  • 43
  • 61

3 Answers3

31

Just combine @mola's answer with what you've got already:

saveas(gca, 'myplot.eps','epsc');

Note the c in 'epsc'.

quazgar
  • 3,670
  • 2
  • 27
  • 37
14

The following works for me:

print -depsc myplot.eps
mola
  • 1,050
  • 1
  • 8
  • 22
2

Here is what you are looking for:

http://www.mathworks.se/matlabcentral/fileexchange/23629-exportfig

mola
  • 1,050
  • 1
  • 8
  • 22