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

Home » Public Forums » archive » Color Tables for Use with Chromatek Glasses
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: Color tables [message #17996 is a reply to message #14270] Mon, 22 November 1999 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Karsten Thiel (thiel@ph4.physik.uni-goettingen.de) writes:

> I'm facing a problem concerning the color tables. I would like to
> display a large array with some negativ
> values. Till now I'm doing this with TVSCL, but the information where
> the values are negativ is very important for me. So how are the
> pre-defined color tables defined? Which table is the best for my
> problem?

Well, Karsten, I hate to tell you, but NONE of the color
tables are best for your problem. And, in fact, if
colors *are* important to you (and they must be or you wouldn't
be writing) then you had better ditch TVSCL too. :-)

Let me give you an example. Suppose you have data in
a variable named "array". And suppose you would like to
see the positive values of the data in the Red Temperature
color table. But you would like to see the negative values
of your data in a yellow color.

Then you could do something like this. Let's suppose
you have 200 colors to use. Let's use 199 of them
for the Red Temperature color scale:

LoadCT, 3, NColors=199

Let's make the 200th color yellow:

TVLCT, 255, 255, 0, 199

Now, lets scale the data so that the positive
values lie in the data range 0 to 198. In other
words, they will be displayed in the Red Temperature
colors:

scaledData = BytScl(array, Min=0, Top=198)

Let's find out where our negative values are:

negvalues = Where( array LT 0, count)

Make the negative values yellow:

IF count GT 0 THEN scaledData[negvalues] = 199B

Now, have a look! :-)

TV, scaledData

It is always better to have some *plan* for using colors
than to just take whatever IDL seems to offer.

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Message index]
 
Read Message
Read Message
Previous Topic: ALIGNING IN PLOT_3DBOX
Next Topic: At Last! A Subsititute for CW_Field.

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

Current Time: Sat Oct 11 03:37:13 PDT 2025

Total time taken to generate the page: 0.47894 seconds