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
cgContour and NaN values [message #86117] Tue, 08 October 2013 10:58 Go to previous message
limiqt is currently offline  limiqt
Messages: 27
Registered: October 2013
Junior Member
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 15:07:28 PDT 2025

Total time taken to generate the page: 0.00457 seconds