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 #79786 is a reply to message #79785] Fri, 30 March 2012 12:55 Go to previous messageGo to previous message
Matteo is currently offline  Matteo
Messages: 28
Registered: August 2011
Junior Member
Oh wait...

The world elevation is already a BYTARR...what I need is a floating
point image to scale.
I'm trying now with image=CGdemodata(2), which has min and max values
of 0. and 1550., but don't get much further trying to plot 10 levels
between 10. and 1000. .
Also, why are scaled_vector and byscl not giving the same result?


pro cbar
compile_opt idl2

nclrs=10
minelev=100.
maxelev=1000.
p = [0.02, 0.15, 0.98, 0.98]

cgLoadCT, 33, NColors=nclrs, Bottom=1
TVLCT, cgcolor('black',/Triple), 0
TVLCT, cgcolor('white',/Triple), nclrs+1

image=cgDemoData(2)
;scaledImage = Scale_Vector(image, 0, nclrs, MINVALUE=minelev,
MAXVALUE=maxelev, /nan)
scaledImage = bytscl(image, MIN=minelev, MAX=maxelev, top=nclrs, /nan)

cgWindow, WXSize=700, WYSize=700
cgImage, scaledimage, position = p, MinValue=0, MaxValue=nclrs,
Top=nclrs-1, $
bottom=1, /Keep, /Add
cgColorbar, Position=[p[0], p[1]-0.1, p[2], p[1]-0.05], NColors=nclrs,
$
Range=[minelev,maxelev], Divisions=10, bottom=1, $
/discrete, OOB_Low='black', OOB_High='white', /Add
stop
end




m
[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 15:26:21 PDT 2025

Total time taken to generate the page: 0.00454 seconds