How to display 518*518 resolution gray scale images in small axes, with gray scale only
Show older comments
Hi, I am new to MATLAB.I want to display 7 Images all of are gray scale images on The screen, for that i have taken 7 axes.
But when the image gets displayed in axes they are not appear in gray scale, they appear as colour images and when the same
image is displayed in Figure window it is displayed as original gray scale image. My images size is 518*518.i want the images
to be in gray scale only in all the axes. How to solve this problem? and also i don't want to reduce the
size of the images. Thanks in advance
Answers (1)
Walter Roberson
on 14 Dec 2011
There is one colormap per figure, so a single colormap(gray) will do. However if you need to display a color image somewhere in the same figure, you are going to run in to problems.
The easiest way to solve these problems would be to take your grayscale image and use
RGBImage = repmat(GrayImage,1,1,3);
and then display RGBImage . This will convert the image from being a pseudocolor image affected by colormaps, in to being a truecolor image that is independent of colormaps.
3 Comments
aatish wankhede
on 15 Dec 2011
Jan
on 15 Dec 2011
This is explained well in the help text.
RGBImage = repmat(GrayImage, [1,1,3])
Another approach:
RGBImage = cat(3, GrayImage, GrayImage, GrayImage);
Or:
RGBImage = GrayImage(:, :, ones(1,3));
aatish wankhede
on 15 Dec 2011
Categories
Find more on Display 2-D Images in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!