Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How do I set colorbar min max?

4,390 views
Skip to first unread message

Florian

unread,
Feb 7, 2008, 10:34:03 AM2/7/08
to
Hey everyone,

how can I code my own limits in the colorbar of a figure???
I've think CLim should do the job, but I have got no clue
how to apply it! :/

Thanks for your help everyone,
Florian

Arthur G

unread,
Feb 7, 2008, 4:28:12 PM2/7/08
to
On Thu, 07 Feb 2008 10:34:03 -0500, Florian <flowwit...@hotmail.com>
wrote:

When you add a colorbar to an axis in a figure, the limits are taken from
CLim. So you need to change CLim on the axis before displaying the color
bar, e.g.:

set(gca, 'CLim', [cLow, cHigh]);

If you don't want to limits of the colorbar to match those of the axis,
you'll have to add another axis to the figure with the desired value of
CLim and add the colorbar to it.

There's an example under CLim in the Matlab documentation that shows how
to "fake" one colorbar for two axes.

--Arthur

Tord

unread,
Jul 16, 2012, 5:19:07 AM7/16/12
to
Ah, thanks Arthur!
Just what I needed!

"Arthur G" <gorramfr...@gmail.com> wrote in message <op.t56a9...@whitaker-four-ninety-one.mit.edu>...
0 new messages