How to export a digit in eps color in matlab

I have a chart in Matlab needed to save eps format. If I use the interactive menu in the figure to do this, everything will be fine, the exported EPS is good. But if I use the following command

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

But if I do so, the exported EPSs are not cropped, and the margin is too high. How to save eps without fields in a program? Thank.

By the way, if I use the following code instead

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

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

+5
source share
3 answers

The following works for me:

print -depsc myplot.eps
+10
source

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

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

Please note c in 'epsc'.

+18
source
+1
source

All Articles