comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Missing fill colours in contour plot
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Missing fill colours in contour plot [message #82779 is a reply to message #82776] Thu, 17 January 2013 09:34 Go to previous messageGo to previous message
Sir Loin Steak is currently offline  Sir Loin Steak
Messages: 42
Registered: January 2012
Member
On Wednesday, January 16, 2013 2:57:39 PM UTC, David Fanning wrote:
> ljs15@fsmail.net writes:
>
>
>
>> The reason for specifying the contours is that the data range from positive to negative values, and I'm using a blue-white-red colour scale to plot (+ve is red, -ve is blue).
>
>>
>
>> In order to make sure white represents 0, I need to set the contour levels to span the maximum range. So if the data had minv = -20 and maxv = +50, I want the contours to range from -50 to +50.
>
>>
>
>> There may be a better way of doing it than what I'm doing though!
>
>
>
> Well, I would do it like this:
>
>
>
>
>
> maxval = Max(Abs(array))
>
> clevels = Scale_Vector(Findgen(ncont), Floor(-maxval), Ceil(maxval))
>
> cgLoadCT, 22, /Brewer, /Reverse, NCOLORS=ncont, BOTTOM=1
>
> ccols = Bindgen(ncont)+1B
>
>
>
> Cheers,
>
>
>
> David
>
>
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
>
> Sepore ma de ni thue. ("Perhaps thou speakest truth.")


Much neater than my hackneyed version. I'll revert to this method - thanks David.

P.S. I never realised there were Brewer colour tables. Whenever I've wanted blue-white-red I've always created my own. This will make my life much easier!
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: CgWindow and multiple plots
Next Topic: Matrices

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 20:57:32 PDT 2025

Total time taken to generate the page: 0.40082 seconds