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

Home » Public Forums » archive » How to create a colour table in IDL?
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: How to create a colour table in IDL? [message #90022 is a reply to message #90016] Thu, 15 January 2015 06:06 Go to previous messageGo to previous message
Burch is currently offline  Burch
Messages: 28
Registered: December 2013
Junior Member
> cgLoadCT, 22, /Brewer
> tvlct, 0, 0, 0, 0
> tvlct, 255, 255, 255, 255
>
> cgColorbar, /Brewer, CTindex=22, TCharsize=0.12, $
> range=[minval,maxval],/right, tlocation='right', $
> Title='d',/Vertical, Font=-1, Minor=5, $
> Position=[0.81,0.32,0.83,0.90]


Firstly, you need to add NCOLORS = 6 to both cgLoadCT and cgColorbar, Secondly, don't use the BREWER and CTINDEX keywords when you call cgColorbar; you have already loaded the color table you want. See the difference between

cgLoadCT, 22, /brewer, nColors = 6
cgColorbar, nColors = 6

and

cgLoadCT, 22, /brewer, nColors = 6
cgColorbar, /brewer, ctIndex = 22, nColors = 6

The last one does not use the color table you have loaded with cgLoadCT. Also note that when you do

tvlct, 0, 0, 0, 0

you are overwriting the first element of the color table. Therefore, black becomes one of the six colors you are using. If this is not the desired behavior, then perhaps you should place this outside the first six elements. I suggest using cIndex to look at what this does to your color table.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: When with the Linux version switch from Motif's to a modern toolkit?
Next Topic: Colors for the Color Blind

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

Current Time: Wed Oct 08 18:18:48 PDT 2025

Total time taken to generate the page: 0.00532 seconds