how to export the figure to color eps in matlab

user1285419 picture user1285419 · Jun 11, 2012 · Viewed 43k times · Source

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.

Answer

quazgar picture quazgar · Sep 2, 2013

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

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

Note the c in 'epsc'.