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 |