Re: log scale of data coloring of IDLgrVolume object, not the axes [message #29249 is a reply to message #29021] |
Fri, 08 February 2002 08:49  |
1
Messages: 1 Registered: February 2002
|
Junior Member |
|
|
David Fanning <david@dfanning.com> wrote in message
>
> HColorbar isn't designed for log scales, of course,
> but I think it is just a matter of passing it a
> color palette of values that have been scaled by
> some kind of log function. For example:
>
> r = BytScl(Findgen(256)^10e-2)
> g = r
> b = r
> thePalette = Obj_New('IDLgrPalette', r, g, b)
> theColorbar = Obj_New('HColorbar', Palette=thePalette)
>
> r = BytScl(Findgen(256)^10e-2)
Why not alog10(Findgen(256)) ??
Thanks David. I had already tried this without success. The colors don't
really ramp properly for a general color table (like Rainbow, colortable
13). Even if it did, the colors would be squished so much on one end that
it'd be difficult to see what colors = what value.
Playing around, I did find that I get good coloring if I log the data as I
bytscl it for the volume object.
loadct, 34 ; rainbow color table
tvLCT, r,g,b, /GET
colorTable = [[r],[g],[b]] ; [256,3] color table for vol coloring
;data of float values in fData. IDLgrVolume's need data bytscl'd
bData = bytscl(alog10(fData), /NaN)
oVol = OBJ_NEW('IDLgrVolume', DATA0=bData, RGB_TABLE0=colorTable)
Now the data looks good, but my Hcolorbar still has text annotations that
range linearly from min(fData) to max(fData). I noticed that David's
hcolorbar is just a little colored IDLgrImage with IDLgrAxis. So, I thought
I'd just set the LOG keyword for the textAxis object in his code, maybe
this'll work:
;//in David's HColorBar code
textAxis = Obj_New("IDLgrAxis", 0, Color=self.color, Ticklen=0.025, $
Major=self.major, Minor=self.minor, Title=thisTitle, Range=self.range,
/Exact, $
XCoord_Conv=longScale, Location=[1000, self.position(1), 0.001], $
/LOG)
but this squooshes this axis all up to the left of where it should be.
Any suggestions?
|
|
|