From: Stephan on
"James Anderson" <janderson_net(a)yahoo.com> wrote in message
> An example can be found in page 69 of the following thesis
> http://reality.media.mit.edu/pdfs/thesis.pdf
> (The top figure of Figure 14)
>
> -James

Hi,

I guess in the example the legend command is used instead.

But however, I do search this approach, too.
Does anybody have an idea how to use discrete patches instead of this smooth transition at colorbars?
Or has to be the legend command used instead?

Thanks in advance,
Stephan
From: us on
"Stephan " <stephand(a)students.uni-mainz.de> wrote in message <hqn92m$7l9$1(a)fred.mathworks.com>...
> "James Anderson" <janderson_net(a)yahoo.com> wrote in message
> > An example can be found in page 69 of the following thesis
> > http://reality.media.mit.edu/pdfs/thesis.pdf
> > (The top figure of Figure 14)
> >
> > -James
>
> Hi,
>
> I guess in the example the legend command is used instead.
>
> But however, I do search this approach, too.
> Does anybody have an idea how to use discrete patches instead of this smooth transition at colorbars?
> Or has to be the legend command used instead?
>
> Thanks in advance,
> Stephan

a hint:
- you can easily create this kind of figure legend with a simple combination of

help patch;
help text;

us
From: Alistair Templeton on
"James Anderson" <janderson_net(a)yahoo.com> wrote in message <hin7i4$8lm$1(a)fred.mathworks.com>...
> Hi,
>
> I am trying to plot a matrix A, its elements have four discrete values: 1,2,3,4.
> What I want to do is to plot the matrix as an image and use four different colors in the colorbar to represent 1:4. An example can be found in page 69 of the following thesis
> http://reality.media.mit.edu/pdfs/thesis.pdf
> (The top figure of Figure 14)
>
> Thanks,
>
> -James

i have in the past just made a separate plot using pcolor(repmat((1:4)',[1 2]) using whatever the colormap you used for your original plot. the axes aren't ideal but it may be reparable with some tweaking