I would like to plot this contour figure in grayscale. I would like to represent higher values in dark shades. Can anyone give me the command to plot this figure? Thanks.
Best Answer
colormap( flipud(gray(256)) )
gray(256) would normally be brighter for higher values, so you reverse the order of the colors to get darker for higher values.
Using a single color channel to convert your image to grayscale is not optimal. The gray tone is usually a combination of red, blue and green. Better use rgb2gray() instead
imwrite(rgb2gray(I1), filename, 'png');
If you really want to save the gray image based on a single channel, then just pass that channel as input to imwrite().
Best Answer