Re: Colorbar with fixed level and color [message #81426 is a reply to message #81424] |
Fri, 14 September 2012 05:53   |
Rosie
Messages: 27 Registered: September 2012
|
Junior Member |
|
|
On Friday, September 14, 2012 1:13:04 PM UTC+1, David Fanning wrote:
> 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.")
Thanks a lot, David. It worked !
Regards,
|
|
|