How do I convert an image to grayscale format and print to eps format in MATLAB 7.6 (R2008a)?

2 visualizaciones (últimos 30 días)
I need to print figures in eps format in grayscale. If I use the command
print('-deps',figname(i))
my figure is cropped correctly and has all of the correct tick limits, etc., but is only in black and white.

Respuesta aceptada

MathWorks Support Team
MathWorks Support Team el 27 de Jun. de 2009
First, if you can, use the export GUI to print to grayscale. In the figure window, select File>Export Setup to open the GUI. Under properties, select Rendering. In the Colorspace drop down menu, you can select grayscale.
Second, you can print from command line. The method you chose depends on the kind of image you are trying to print.
If you are trying to print an image with an associated colormap you can convert your image to grayscale first before printing to eps. For instance:
surf(peaks);
colormap(gray);
print -deps testimg
If you are trying to print a plot, with which there is no associated colormap, you may have to use HGEXPORT:
plot(rand(10))
style = hgexport('factorystyle');
style.Color = 'gray';
hgexport(gcf,'test.eps',style);

Más respuestas (0)

Etiquetas

Aún no se han introducido etiquetas.

Productos


Versión

R2008a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by