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

Home » Public Forums » archive » Adding extra white in middle of colour 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: Adding extra white in middle of colour bar [message #85607 is a reply to message #85606] Wed, 21 August 2013 06:33 Go to previous messageGo to previous message
Sir Loin Steak is currently offline  Sir Loin Steak
Messages: 42
Registered: January 2012
Member
On Wednesday, 21 August 2013 14:03:57 UTC+1, David Fanning wrote:
> ljs15@fsmail.net writes:
>
>
>
>> I am plotting data that range from negative to positive, so am using a blue-white-red colour bar. However, I would like there to be more white in the middle of the bar.
>
>>
>
>> At the moment I'm using the following clumsy commands to achieve this:
>
>>
>
>> maxv = 10
>
>> cgloadct, 13, /brewer, /reverse, ncolors=9, bottom=0, /silent, clip=[0,225]
>
>> cgloadct, 16, /brewer, ncolors=9, bottom=12, /silent, clip=[0,225]
>
>> clev = scale_vector(findgen(21), -maxv, maxv)
>
>> ccol = bindgen(21)
>
>> ;Make middle levels white
>
>> ccol[9:11] = cgcolor('white')
>
>>
>
>> and then:
>
>>
>
>> cgColorbar, ncolors=20, range=[-maxv, maxv]
>
>>
>
>> While this gives me the plot shading I want, the colour bar is incorrect. As I have manually altered the middle values to white, they don't show in the colour bar, which only uses the 18 colours defined by cgloadct.
>
>>
>
>> Is there a simple way around this?
>
>
>
> I think the simplest way around it is this:
>
>
>
> cgLoadCT, 22, /Brewer, /Reverse, NColors=20
>
> cgColorBar, NColors=20, range=[-10,10]
>
>
>
> Cheers,
>
>
>
> David
>
>
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
>
> Sepore ma de ni thue. ("Perhaps thou speakest truth.")

Hi David,

That's the method I originally used, but that means the white colour is only being given to the middle contour range.

What I want (for example) is eight contours -10,-9,...,-2 to be shades of blue, and eight contours 2,3,...,10 to be shades of red, and the contours between -2 and +2 to be white.

Not sure if this is possible without having to manually make a colour table and load it with tvlct.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: spawn not working
Next Topic: Navigating AVIRIS Images

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

Current Time: Fri Oct 10 07:49:18 PDT 2025

Total time taken to generate the page: 1.20003 seconds