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

2 vues (au cours des 30 derniers jours)
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.

Réponse acceptée

MathWorks Support Team
MathWorks Support Team le 27 Juin 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);

Plus de réponses (0)

Tags

Aucun tag saisi pour le moment.

Produits


Version

R2008a

Community Treasure Hunt

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

Start Hunting!

Translated by