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

Home » Public Forums » archive » Re: COLOR BAR
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 BAR [message #2538] Wed, 27 July 1994 05:43 Go to previous message
landers is currently offline  landers
Messages: 45
Registered: May 1993
Member
Victor Shvetsky writes:
|>
|> I was wondering if anyone has a routine for widgets that would plot a nice
|> color bar AND put some value on it. I can create a color bar, but I am not
|> able to put text on it NICELY, unless I use XYOUTS.
|> any suggestions would be greatly appreciated.
|>

You can use AXIS, something like this:

; first set up a plot space - make a null plot with no axes
; you could add a Position keyword to put it somewhere special
; Use /NoErase if you're adding the color bar to an existing plot

PLOT,[0,1],/NoData,XStyle=4,YStyle=4

; get the corners of the plot space (in device units)

px = !X.Window * !D.X_VSize
py = !Y.Window * !D.Y_VSize

; get the widths of the plot space

swx = px(1) - px(0)
swy = py(1) - py(0)

; Draw the color bar (colors run from index 0 at left to !D.N_Colors-1
; at right)

TVSCL, FINDGEN(swx) # REPLICATE(1.,swy), px(0),py(0), /Device

; Now add an axis. You can use any of the XRange, XStyle, XTicks, etc.
; keywords to make the axes what you like.
; I usually like to make XTicklen a small negative number so the axis ticks
; hang below the axis, rather than getting lost in the color bar

AXIS, XAxis=0., XRange=[0,10], XTicklen=-0.02
^^^^^^
Your range goes here.....

Luck
;Dave
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: IDL 3.6.1 does not start on AIX
Next Topic: Re: MAP=0 and EDITABLE conflict

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

Current Time: Fri Oct 10 16:05:40 PDT 2025

Total time taken to generate the page: 0.96026 seconds