Search code examples
matlabeps

how to export the figure to color eps in matlab


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.


Solution

  • The following works for me:

    print -depsc myplot.eps