On Tuesday, December 3, 2013 5:19:21 PM UTC-5, David Fanning wrote:
> Morgan Silverman writes:
>
>
>
>> I'm trying to color a selection of the data I've plotted but am having a hard time getting the color bar and data colors to match correctly. I've plotted data that has altitudes from 0-5 km but only want to have a range of colors from 0-2 km and have everything above 2 km the same last color bar value (color 256). I've created a color bar with 256 colors from 0-2, but I can't seem to get this to match the colors of the data in the figure. Any suggestions
>
>
>
> Are you by any chance talking about a filled contour plot? If so, have
>
> you read this article?
>
>
>
> http://www.idlcoyote.com/cg_tips/oobcontour.php
>
>
>
> If not, maybe you could get us a better idea of what you are doing so we
>
> would have basis for answering your question. :-)
>
>
>
> 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.")
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. Thank you.
loadct, 33
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]
colors=bytscl(DAQalt)
cgplot, DAQlon, DAQlat, /nodata, xstyle=1, ystyle=1, xrange=lonrange, yrange=latrange, position=pp,/noerase
position=pp,/noerase
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]
|