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

Home » Public Forums » archive » Re: fun with nonlinearity and COLORBAR
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: fun with nonlinearity and COLORBAR [message #72962] Thu, 21 October 2010 12:35 Go to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Jeremy Bailin writes:

> I'm looking for advice on a plot I'm making that uses David's COLORBAR
> routine. The problem is that the mapping between color index in the
> image and data value is quite non-linear - and not a simple
> transformation, either (it's generated via histogram equalization).
>
> There are a few ways I can imagine having it look. So first, from an
> aesthetics (and ease-of-understanding) standpoint, which would be
> best?
> 1. The colorbar has one line for each color index, and is annotated
> using 6 evenly-spaced divisions, but the numbers marking those
> divisions are not evenly distributed.
> 2. The colorbar has one line for each color index, the annotations
> are evenly spaced in *value*, but are spaced unevenly along the color
> bar.
> 3. The colorbar is annotated using 6 evenly-spaced divisions that
> have evenly-spaced numbers, and the colors within the color bar vary
> (i.e. the mapping between row up the color bar and color index is no
> longer linear).
>
> The second question is implementation. I can achieve #1 very easily
> using COLORBAR. I think that in order to do #2, I would need to
> essentially roll my own version of COLORBAR that changes the
> annotation locations - are there any shortcuts that would let me use
> the existing routine? To do #3, my best idea is to regenerate a new
> (non-linearly altered) color table, and then use the existing COLORBAR
> routine. Any caveats with that, or any easier ways to do it?
>
> Alternatively, what other ideas do people have for conveying this kind
> of information?

If you are talking about six discrete colors, I would use
the discrete color bar, DCBAR.

I have implemented something like number 1, equally spaced
divisions, with non-linear values, using FSC_Colorbar (new
name!) in this article:

http://www.dfanning.com/map_tips/precipmap.html

I had to use a tick formatting function to do it correctly.

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.")
Re: fun with nonlinearity and COLORBAR [message #73105 is a reply to message #72962] Thu, 21 October 2010 19:34 Go to previous message
Jeremy Bailin is currently offline  Jeremy Bailin
Messages: 618
Registered: April 2008
Senior Member
On Oct 21, 3:35 pm, David Fanning <n...@dfanning.com> wrote:
> Jeremy Bailin writes:
>> I'm looking for advice on a plot I'm making that uses David's COLORBAR
>> routine. The problem is that the mapping between color index in the
>> image and data value is quite non-linear - and not a simple
>> transformation, either (it's generated via histogram equalization).
>
>> There are a few ways I can imagine having it look. So first, from an
>> aesthetics (and ease-of-understanding) standpoint, which would be
>> best?
>>   1. The colorbar has one line for each color index, and is annotated
>> using 6 evenly-spaced divisions, but the numbers marking those
>> divisions are not evenly distributed.
>>   2.  The colorbar has one line for each color index, the annotations
>> are evenly spaced in *value*, but are spaced unevenly along the color
>> bar.
>>   3.  The colorbar is annotated using 6 evenly-spaced divisions that
>> have evenly-spaced numbers, and the colors within the color bar vary
>> (i.e. the mapping between row up the color bar and color index is no
>> longer linear).
>
>> The second question is implementation. I can achieve #1 very easily
>> using COLORBAR. I think that in order to do #2, I would need to
>> essentially roll my own version of COLORBAR that changes the
>> annotation locations - are there any shortcuts that would let me use
>> the existing routine? To do #3, my best idea is to regenerate a new
>> (non-linearly altered) color table, and then use the existing COLORBAR
>> routine. Any caveats with that, or any easier ways to do it?
>
>> Alternatively, what other ideas do people have for conveying this kind
>> of information?
>
> If you are talking about six discrete colors, I would use
> the discrete color bar, DCBAR.
>
> I have implemented something like number 1, equally spaced
> divisions, with non-linear values, using FSC_Colorbar (new
> name!) in this article:
>
>   http://www.dfanning.com/map_tips/precipmap.html
>
> I had to use a tick formatting function to do it correctly.
>
> 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.")

Ah yes, FSC_COLORBAR. ;-) I haven't switched to 8.0 yet, so I'm still
safe from that issue for now...

It's a continuous color bar (basically color table 4 with a slight
modification). I've got a feeling that #3 is the aesthetically-correct
thing to do. Not coincidentally, it's probably the one that requires
the most work. Ah well...

-Jeremy.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Get Lat/long equivalent based on NEASE grid value
Next Topic: Chance to Become Famous in IDL Circles!

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

Current Time: Wed Oct 08 19:16:10 PDT 2025

Total time taken to generate the page: 0.00704 seconds