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

Home » Public Forums » archive » Color Data with Colorbar OOB Colors
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: Color Data with Colorbar OOB Colors [message #86788 is a reply to message #86787] Tue, 03 December 2013 16:36 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Morgan Silverman writes:

> I apologize for not being clear. No this is not a contour plot. I am plotting individual latitude vs longitude points as symbols. I want each of those points colored by the corresponding altitude but only colored up to 2 km, above they should all be the same color. I still need to be able to see all points though. When I tried to limit, I also limit plotting the locations above 2 km. I've included a bit of plotting code. I hope this helps

I would do it like this:

DAQlon = cgScaleVector(Randomu(seed, 100), -75.5, -77.75)
DAQLat = cgScaleVector(Randomu(seed, 100), 38.25, 40.0)
DAQAlt = cgScaleVector(Randomu(seed, 100), 0.0, 3.0)
shoredata = 'gshhs_i.b'

tooHigh = Where(DAQAlt GT 2.0, count)
colors=bytscl(DAQalt, Top = 254)
IF count GT 0 THEN colors[tooHigh] = 255
cgLoadCT, 33, NColors=254
TVLCT, cgColor('charcoal', /Triple), 255

lonrange = [-77.75, -75.5] ; Flight 7,8,9,12,13,14
latrange=[38.25, 40] ; Flight 7,8,9,12,13,14
limit = [latrange(0),lonrange(0),latrange(1),lonrange(1)]
pp=[0.1,0.1,0.82,0.95]

cgplot, DAQlon, DAQlat, /nodata, xstyle=1, ystyle=1, $
xrange=lonrange, yrange=latrange, position=pp
cgMap_set, 38.25, -76.5, limit=limit, /lambert, $
/noerase, position=pp ;37,-76.35 for zoomed in...37.2, -76.7 zoomed
out
cgMap_GSHHS, ShoreData, Fill=1, Level=3, Color='black', /Outline
cgplots, DAQlon, DAQlat, psym=2, color=colors
cgColorbar, divisions=4, range=[0,2], /Vertical, /right, $
charsize=1, position=[0.83,0.1,0.86,0.9], NColors=254, $
OOB_High='charcoal'
END


--
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.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Resample (neighborhood averaging) a 3D array with missing data
Next Topic: xmargin and ymargin keywords ignored in cgplot

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

Current Time: Fri Oct 10 22:41:28 PDT 2025

Total time taken to generate the page: 0.64068 seconds