Re: Inverting colourtable [message #25657] |
Thu, 05 July 2001 07:21 |
david[2]
Messages: 100 Registered: June 2001
|
Senior Member |
|
|
Simon de Vet writes:
> Will this still work for postscript output? I'm not doing any of my
> visualization on screen.
Sigh... Probably not.
I'm guessing you don't really know what color indices
you are using to draw your filled contour colors in.
If you did (and you should), you probably wouldn't
be asking this question, since the answer would be
so simple: reverse the numbers!
I'd leave the color table alone (it will be decades
before color is needed on computers anyway) and do
something like this. Suppose you have 20 contour
levels you intend to visualize:
nsteps = 20
LOADCT, 0, NColors=20, Bottom=1
step = (Max(data) - Min(data)) / nsteps
nlevels = Indgen(nsteps) * step + Min(data)
Contour, data, Levels=nlevels, /Fill, $
C_Colors=Reverse(Indgen(nsteps)+1)
That will work *everywhere*. :-)
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
|
|
|
Re: Inverting colourtable [message #25660 is a reply to message #25657] |
Thu, 05 July 2001 06:13  |
Simon de Vet
Messages: 36 Registered: May 2000
|
Member |
|
|
Ben Tupper wrote:
> Hi,
>
> You can use the TVLCT procedure to get and then set the colors...
>
> IDL> tvlct, r,g,b, /get
> IDL> help, r,g,b
> R BYTE = Array[256]
> G BYTE = Array[256]
> B BYTE = Array[256]
> IDL> tvlct, reverse(r), reverse(g), reverse(b)
Will this still work for postscript output? I'm not doing any of my
visualization on screen.
-- Simon
|
|
|
Re: Inverting colourtable [message #25661 is a reply to message #25660] |
Thu, 05 July 2001 06:07  |
btt
Messages: 345 Registered: December 2000
|
Senior Member |
|
|
Hi,
You can use the TVLCT procedure to get and then set the colors...
IDL> tvlct, r,g,b, /get
IDL> help, r,g,b
R BYTE = Array[256]
G BYTE = Array[256]
B BYTE = Array[256]
IDL> tvlct, reverse(r), reverse(g), reverse(b)
Ben
Simon de Vet wrote:
>
> I've been printing a lot of filled contour maps using the B&W colour
> table (CT#0). This was great when I had mostly white or light grey
> values, but lately I've been in the black, and this seriously eats up
> the toner.
>
> Is there an quick and easy way to reverse the colours in a colourtable?
>
> -- Simon
--
Ben Tupper
Bigelow Laboratory for Ocean Sciences
180 McKown Point Rd.
W. Boothbay Harbor, ME 04575
btupper@bigelow.org
|
|
|