Re: Missing fill colours in contour plot [message #82801 is a reply to message #82779] |
Wed, 16 January 2013 06:57   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
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.")
|
|
|