From: ImageAnalyst on
On Feb 3, 4:25 pm, "uny gg" <illinois...(a)gmail.com> wrote:
> > However, I am still have a problem.
> > My data matrix(actually representing the image) has narrow scale range.
> > That was the reason I have to use "imagesc" function which helps to expand the original small range into the large range.
>
> For example, one of my image has range of -0.0298 to 0.0254.
> So, in this case, only "imagesc" function can clearly shows that the relative expression in image (bright to dark)

--------------------------------------------------------------------------
And what do you consider to be the background intensity that you want
to appear as the color you specify (black, white, or gray)? Is it
-0.0298?
From: uny gg on

> --------------------------------------------------------------------------
> And what do you consider to be the background intensity that you want
> to appear as the color you specify (black, white, or gray)? Is it
> -0.0298?

What I want to put as a background color (black, white or gray). However, when I put the -0.0298 (lowest value in the image) into the pixels in background, it appeas as a dark blue.. Since imagesc function color bar starts from dark blue to dark red.. There is no black or white or gray color in the color bar. That's was the reason I have a trouble to change the background color as a color which are not in the color bar ... ( When I used "imagesc" function.) Sorry for this stupid question.

Thanks again.
From: uny gg on

> --------------------------------------------------------------------------
> And what do you consider to be the background intensity that you want
> to appear as the color you specify (black, white, or gray)? Is it
> -0.0298?

What I want to put as a background color (black, white or gray). However, when I put the -0.0298 (lowest value in the image) into the pixels in background, it appeas as a dark blue.. Since imagesc function color bar starts from dark blue to dark red.. There is no black or white or gray color in the color bar. That's was the reason I have a trouble to change the background color as a color which are not in the color bar ... ( When I used "imagesc" function.) Sorry for this stupid question.

Thanks again.
From: Image Analyst on
uny gg:
Alright, let's start with some demo code and go from there.
Run this, and then tell me what you want to do.

minValue = -0.0298;
maxValue = 0.0254;
range = maxValue - minValue;
imageArray = range * rand(100,300) + minValue;
imagesc(imageArray);
set(gcf, 'Position', get(0,'Screensize')); % Maximize figure.colorbar; % Show the "jet" colormap.
myColorMap = colormap;
% Change the bottom color to be black.
myColorMap(1,:) = [0 0 0];
% Apply it.
colormap(myColorMap);