Re: Colorbar with fixed level and color [message #81428 is a reply to message #81426] |
Fri, 14 September 2012 05:12   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Rosie writes:
>
> Hello,
>
> I have created contour plot with following color and levels
>
> loadct,39
> nl=21; nl,number of level
> color=(findgen(nl+1)*10)+50
> level=findgen(nl)*.5-5
>
> Would anyone kindly tell how to plot colorbar with this specification.
Well, those specifications don't make too much sense, since
there is no "color" at index 260. But, what I *think* you
are trying to do is something like this:
cgLoadCT, 39, Clip=[50,254], NColors=20, Bottom=1
cgColorBar, NColors=20, Bottom=1, /Discrete, $
Range=[Min(level),Max(level)], Charsize=0.75
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|