help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: colorbar for decimal images


From: Ben Abbott
Subject: Re: colorbar for decimal images
Date: Fri, 30 Oct 2009 11:40:29 -0400

On Oct 30, 2009, at 7:54 AM, Lorenzo Trojan <address@hidden> wrote:

Hi all,

sorry for asking this question, I've been looking around but I couldn't find a solution to this.

I have a matrix of intensities. The intensity of each pixel is a double number ranging from e-4 to e-3 and I'd like to produce an image using image() or imshow() and add a colorbar showing the correct range of values. I could do something like:

> minmat = min (min (matrix)) ;
> maxmat = max (max (matrix)) ;
> delmat = maxmat - minmat ;
> imgmat = (matrix + minmat) * 64 / delmat ;
> image (imgmat);
> colormat (hot (64)) ;
> colorbar ();

but then the colorbar would show the range from 1 to 64.

is there a way to change the labels to the colorbar so that it display the range of the original image limits? I tried to look for the axis object associated with the colorbar, but I could't find them...

You can obtain the handle to the colorbar by

hc = findall (gcf, "tag", "colorbar", "type", "axes");

Or when you create the colorbar ...

hc = colorbar ();

Ben

reply via email to

[Prev in Thread] Current Thread [Next in Thread]