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

Home » Public Forums » archive » Re: CG Elevation image + arbitrary discrete colorbar
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: CG Elevation image + arbitrary discrete colorbar [message #79785] Fri, 30 March 2012 13:12 Go to previous message
DavidF[1] is currently offline  DavidF[1]
Messages: 94
Registered: April 2012
Member
Matteo wrote:

> Dave, thank you. If I do what you suggested, Himalaya comes out in
> between 1800 and 2000m, and most of the world's oceans at 200-400
> m. :-|
> Nothing is black or white.
>
> I guess Nata's way is the hard way but I thought this is what OOB_Low
> and OOB_High were for?

Well, this was a pretty ill-formed question. Maybe you are looking
for something like this, where I arbitrarily scale the data between
-400 and 9000 meters:

image = cgdemodata(7)
image = scale_vector(Float(image), -400.0, 9000.0)
belowSeaLevel = Where(image LT 0.0, belowCnt)
above6000meters = Where(image GT 6000.0, aboveCnt)
scaledImage = BytScl(image, MIN=0, MAX=6000, TOP=9) + 2B
IF belowCnt GT 0 THEN scaledImage[belowSeaLevel] = 1B
IF aboveCnt GT 0 THEN scaledImage[above6000Meters] = 12B

tvlct, cgcolor('black', /Triple), 1
cgLoadCT, 33, NColors=10, Bottom=2
tvlct, cgColor('white', /Triple), 12

cgDisplay, color='gray'
cgimage, scaledImage, position=[0.1, 0.1, 0.9, 0.75], /Keep
cgColorbar, NColors=10, Bottom=2, oob_Low=1, oob_High=12, $
Divisions=10, Range=[0,6000], /Discrete
END

Cheers,

David

P.S. My news provider is failing me! No news for days now. Resorting to Google Groups. :-(
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Cannot see anything in the postscript file. Any help?
Next Topic: Taskbar and Windows

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

Current Time: Wed Oct 08 13:32:06 PDT 2025

Total time taken to generate the page: 0.00346 seconds