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

Home » Public Forums » archive » Re: Logarithmic Color Scaling
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: Logarithmic Color Scaling [message #51791 is a reply to message #51697] Tue, 05 December 2006 13:21 Go to previous message
JD Smith is currently offline  JD Smith
Messages: 850
Registered: December 1999
Senior Member
On Tue, 05 Dec 2006 13:20:11 -0700, David Fanning wrote:

> Braedley writes:
>
>> [quoted text muted]
>
> Well, I've been looking for the trivial solution for
> the past 48 hours straight. I'd be delighted to be
> pointed in the right direction. May I see your code?
>
> I do agree with you that it is trivial to
> label a color bar logarithmically. What I am finding
> difficult is making the colors associated with the
> color bar labels accurately reflect the values
> in the data, which seems to me to be pretty much the
> point of a color bar.
>
> With the exception of spectro_plot from the SolarSoft
> library, which I have still not had time to download,
> I have seen a lot of advice, but no working code. This
> leads me to believe maybe it's not as trivial as everyone
> (including me) thought it might be. :-)


I'm not sure what the big mystery is. Here's a simple code illustrating
my case 'a' (the "don't scale the colorbar indices" case):

loadct,0
d=dist(256) + 1.

;; Set the color where d=100 to red
index100=round(alog10(100.)/(alog10(max(d))-alog10(min(d)))* 256)
tvlct,255,0,0,index100

tvscl,alog10(d),10,10
colorbar=rebin(indgen(256),256,60)
tv,colorbar,10,(yb=10+256+20)
plot,[0],[0],/NODATA,/NOERASE,POSITION=[10,yb,256+10,yb+60], $
/DEVICE,XRANGE=[min(d),max(d)],/XLOG,/XSTYLE,YSTYLE=4,XTICKL EN=.15, $
COLOR=2*!D.TABLE_SIZE/3


JD
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDL_IDLBridge GetVar vs. Shared Memory
Next Topic: IDL 6.3 Directory Change?

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

Current Time: Fri Oct 10 17:28:25 PDT 2025

Total time taken to generate the page: 0.32164 seconds