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

Home » Public Forums » archive » Re: How to load a customized color table?
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 load a customized color table? [message #64646 is a reply to message #64637] Sat, 10 January 2009 09:57 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
ICBM0926 writes:

> I've tried to load a customized color table with "TVLCT" in a
> procedure. I called this procedure from another one, but the plot
> generated uses B-W color table instead of a red-blue one.
> I can't get this thing work. Can anyone tell me where go wrong?
>
> The code is attached below.
> pro ctloader
> ;loadct,25
> ;COMMON COLORS, R_Orig, G_Orig, B_Orig, R_curr, G_curr, B_curr
> COMMON COLORS, r, g, b, R_curr, G_curr, B_curr
> print,"This is ctloader."
> r=dblarr(256)
> r[0:127]=reverse(2.0*findgen(128))
> r[128:255]=0.0
> R_curr=r
> b=dblarr(256)
> b[0:127]=0.0
> b[128:255]=2.0*findgen(128)
> B_curr=b
> g=dblarr(256)
> g=0.0
> G_curr=g
> tvlct,r,g,b
> end

When you set g=0, you are effectively loading only
a single color. The only color your load is at index 0.

You can see this if you look at your color table with
CINDEX:

http://www.dfanning.com/programs/cindex.pro

If you take that line out, you get a red-blue color
table. Is that what you were going for?

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
Previous Topic: how to use wavelet transformation function in IDL?
Next Topic: Re: Solve memory problems

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

Current Time: Sun Oct 12 00:03:02 PDT 2025

Total time taken to generate the page: 1.23845 seconds