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

Home » Public Forums » archive » Re: fit image to logarithmic 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: fit image to logarithmic color bar [message #62408 is a reply to message #62406] Mon, 08 September 2008 06:08 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
maffie writes:

> I am trying to fit my data vector to a logarithmic colorbar. For the
> latter, I use the code suggested by David on the following link:
> http://www.dfanning.com/graphics_tips/logcb.html.
>
> Now, I have for example a vector X = [4.0, 0.04, 65.88, 3.62, 2.75,
> 7.04, 1.12,1.65]
> whereby my color bar ranges logarithmically from 0.001 to 100. So the
> colors for each of this vector point element fit my logarithmic color
> bar. I guess I should do something with the scale_vector function, or
> bytscl, but I can't seem to get it right??
>
> I need to create a vector which contains a number (corresponding to an
> element of vector X) that I can use to extract the correct number
> referring to a color from the color bar. For each element, a box is
> filled with a specific color (here for I am using POLYFILL, so my
> image is not a continuum, but a chain of boxes, each with it's own
> color. Now, I need to get the color right following my logarithmic
> scale bar....
>
> I hope this is clear and somebody can help me out?

I think you want this:

IDL> x = [4.0, 0.04, 65.88, 3.62, 2.75, 7.04, 1.12, 1.65]
IDL> Print, BytScl(x, MIN=0.001, MAX=100)
10 0 168 9 7 18 2 4

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: converting a string to an IDL command
Next Topic: :-) bug during envi 4.5 installation

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

Current Time: Fri Oct 10 14:55:48 PDT 2025

Total time taken to generate the page: 1.75749 seconds