From: Patrick L. on
Hello,

I wanted to know if there's a way to create a legend showing the
intensity values of each pixel in an image. What I'm trying to get is
something that shows what color (from white to black) corresponds to
what pixel value on the image plot (using the imagesc command).

For example, white = x, black = y, where x and y are whatever values
white and black correspond to in the image.

From: Patrick L. on
On Jul 15, 10:14 am, "Patrick L." <pll...(a)email.arizona.edu> wrote:
> Hello,
>
> I wanted to know if there's a way to create a legend showing the
> intensity values of each pixel in an image.  What I'm trying to get is
> something that shows what color (from white to black) corresponds to
> what pixel value on the image plot (using the imagesc command).
>
> For example, white = x, black = y, where x and y are whatever values
> white and black correspond to in the image.

By the way, I *think* that, in my images, -1 corresponds to black, 0
corresponds to gray, and +1 corresponds to white.
From: Steven Lord on

"Patrick L." <pllull(a)email.arizona.edu> wrote in message
news:fd4c87ca-223c-414a-962e-549d6a3244ef(a)k8g2000prh.googlegroups.com...
> Hello,
>
> I wanted to know if there's a way to create a legend showing the
> intensity values of each pixel in an image. What I'm trying to get is
> something that shows what color (from white to black) corresponds to
> what pixel value on the image plot (using the imagesc command).
>
> For example, white = x, black = y, where x and y are whatever values
> white and black correspond to in the image.

If you're using a GRAY colormap to display your image, look at the COLORBAR
function.

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com


From: Patrick L. on
On Jul 15, 10:59 am, "Steven Lord" <sl...(a)mathworks.com> wrote:
> "Patrick L." <pll...(a)email.arizona.edu> wrote in message
>
> news:fd4c87ca-223c-414a-962e-549d6a3244ef(a)k8g2000prh.googlegroups.com...
>
> > Hello,
>
> > I wanted to know if there's a way to create a legend showing the
> > intensity values of each pixel in an image.  What I'm trying to get is
> > something that shows what color (from white to black) corresponds to
> > what pixel value on the image plot (using the imagesc command).
>
> > For example, white = x, black = y, where x and y are whatever values
> > white and black correspond to in the image.
>
> If you're using a GRAY colormap to display your image, look at the COLORBAR
> function.
>
> --
> Steve Lord
> sl...(a)mathworks.com
> comp.soft-sys.matlab (CSSM) FAQ:http://matlabwiki.mathworks.com/MATLAB_FAQ
> To contact Technical Support use the Contact Us link onhttp://www.mathworks.com

I did, and it looks like the one I want to use is
colorbar(...,'location'). What parameter is "..."? Is that the name
of the image?
From: Steven Lord on

"Patrick L." <pllull(a)email.arizona.edu> wrote in message
news:00d8f5b0-8866-45f9-9f83-d003af8e6bdc(a)y32g2000prc.googlegroups.com...
On Jul 15, 10:59 am, "Steven Lord" <sl...(a)mathworks.com> wrote:

*snip*

> > If you're using a GRAY colormap to display your image, look at the
> > COLORBAR
> > function.
> >
> > --
> > Steve Lord
> > sl...(a)mathworks.com
> > comp.soft-sys.matlab (CSSM)
> > FAQ:http://matlabwiki.mathworks.com/MATLAB_FAQ
> > To contact Technical Support use the Contact Us link
> > onhttp://www.mathworks.com
>
> I did, and it looks like the one I want to use is
> colorbar(...,'location'). What parameter is "..."? Is that the name
> of the image?

That means you can add the 'location' option (with an appropriate value from
the table on the reference page for COLORBAR substituted for the literal
word 'location', of course) at the end of a usage using one of the other
syntaxes listed on that page

http://www.mathworks.com/access/helpdesk/help/techdoc/ref/colorbar.html

For example, you could say:

colorbar('Peer', gca, 'North') % Add the location to the colorbar('Peer',
axes_handle) syntax

or even just:

colorbar('East') % Add the location to the colorbar [no inputs] syntax

Similarly, you could put the 'Peer' syntax at the end of the 'location'
syntax.

colorbar('South', 'Peer', gca)

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com