Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to export the figure to color eps in matlab

Tags:

matlab

eps

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.

like image 567
user1285419 Avatar asked Jun 11 '12 18:06

user1285419


People also ask

How do I save a figure as a EPS in MATLAB?

Save Figure as EPS FileCreate a bar chart and save it as an EPS file. Specify the 'epsc' driver to save it in color. saveas saves the bar chart as Barchart. eps .

How do I export a figure in MATLAB?

Use the File > Export Setup dialog. Use Edit > Copy Figure to copy the figure's content to the system clipboard. For details, see Customize Figure Before Saving and Copy Figure to Clipboard from Edit Menu.

Can MATLAB open EPS files?

The Encapsulated PostScript (EPS) vector format is the most reliable and consistent file format MATLAB supports.

How do I save a high resolution figure in MATLAB?

To save a figure as an image at a specific resolution, call the exportgraphics function, and specify the 'Resolution' name-value pair argument. By default, images are saved at 150 dots per inch (DPI). For example, create a bar chart and get the current figure. Then save the figure as a 300-DPI PNG file.


1 Answers

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

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

Note the c in 'epsc'.

like image 101
quazgar Avatar answered Oct 21 '22 12:10

quazgar