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

Home » Public Forums » archive » cgContour and NaN values
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: cgContour and NaN values [message #86119 is a reply to message #86117] Tue, 08 October 2013 11:55 Go to previous messageGo to previous message
Andy Sayer is currently offline  Andy Sayer
Messages: 127
Registered: February 2009
Senior Member
With the caveat that I haven't tested, this, I spot your code specifies missing=!Values.F_Nan . I'd either change that to -999, or else leave your missing values as !values.f_nan . I'd try that.

Andy

On Tuesday, October 8, 2013 1:58:09 PM UTC-4, Lim wrote:
> Dear all,
>
> I am having some trouble using contour with data which has NaN values. My valid range of data is -1 to 1. I have also change the NaN to -999. In that case the -999 appear as the same color as -1. I would like that the NaN values appear as white. Please, Could you tell me what I am doing wrong? (I am following a example I found at http://www.idlcoyote.com/graphics_tips/contourcolors.php but Im sure i missed somthing)
>
>
>
> my data is [192,145]
>
>
>
> data
>
> minval=-1.
>
> maxval=1.
>
> data=cgScaleVector(data, minval, maxval, /NaN)
>
>
>
> cgwindow
>
> ncontours = 10
>
> cgLoadCT, 22, /Brewer, /Reverse, NColors=ncontours
>
> clevels = cgScaleVector(Findgen(ncontours+1), minval, maxval, /NaN)
>
> colors = Bindgen(ncontours+1) + 1B
>
> cgContour, data, lons, lats, Levels=clevels, C_Colors=colors, /Fill, missing=!Values.F_Nan, Position=[0.125, 0.125, 0.925, 0.8], /AddCmd
>
> cgColorbar, NColors=ncontours, Range=[minval,maxval], Divisions=10, $
>
> Bottom=1, Ticklen=0.001, /AddCmd
>
>
>
> Thanks
>
> Lim.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: scopes
Next Topic: Yet another user with poly_fit problems

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

Current Time: Wed Oct 08 19:59:15 PDT 2025

Total time taken to generate the page: 0.00429 seconds