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

1 Ansicht (letzte 30 Tage)
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.

Akzeptierte Antwort

MathWorks Support Team
MathWorks Support Team am 27 Jun. 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);

Weitere Antworten (0)

Tags

Noch keine Tags eingegeben.

Produkte


Version

R2008a

Community Treasure Hunt

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

Start Hunting!

Translated by