How do I convert an image to grayscale format and print to eps format in MATLAB 7.6 (R2008a)?
2 次查看(过去 30 天)
显示 更早的评论
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.
采纳的回答
MathWorks Support Team
2009-6-27
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);
0 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!