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

Home » Public Forums » archive » Re: changing colors
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: changing colors [message #6656] Thu, 01 August 1996 00:00
MICHEL KRUGLANSKI is currently offline  MICHEL KRUGLANSKI
Messages: 14
Registered: August 1996
Junior Member
Hi,

1/ make first a simple test:

idl
> window, 0
> print, !d.n_colors
> loadct, 3
> palette

then, you will know how many colors you get and if
the colors appear correctly on your screen.

Now, if you want to use a fixed number of colors,
you must start IDL as follow:

idl
> device, pseudo = 8
> window, col = 256

(see Reference Guide, Chapter 3, section 'Using Color Under X')

> loadct, 3
> palette

2/ you can use only one color table. So, if you have a greyscale
picture and you want to trace a red line, you need a color
table which include greyscale and red...

idl
> device, pseudo = 8
> window, col = 256
> r=[ 0, 0, 0, 0, 0, 0, 0,128,255,255,255,255,255,222,220,255, $
> 0, 2, 4, 6, 9, 11, 13, 16, 18, 20, 22, 25, 27, 29, 32, 34, 36, 39, 41, $
> 43, 45, 48, 50, 52, 55, 57, 59, 62, 64, 66, 68, 71, 73, 75, 78, 80, 82, 85 ]
> r=[r,87, 89, 91, 94, 96, 98,101,103,105,107,110,112,114,117,119,121,124,126,128, $
> 130,133,135,137,140,142,144,147,149,151,153,156,158,160,163, 165,167,170,172, $
> 174,176,179,181,183,186,188,190,192,195,197,199,202,204,206, 209,211,213,215 ]
> r=[r, 218,220,222,225,227,229,232,234,236,238,241,243,245,248,250, 252,255, $
> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, $
> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
> r=[r, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 25, 41, 57, 73, 90,106,122,138, $
> 154,170,187,203,219,235,255, $
> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]
> r=[r, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 37, 67, 97,125,145,165,185,200,202, $
> 204,206,208,210,213,215,217,219,221,223,225,227,229,231,233, 235,237,239,241, $
> 243,245,247,249,251,253,255 ]
> g=[ 0,168,255,255,255,255, 0, 0, 0, 0, 0, 0, 0,190,220,255, $
> 0, 2, 4, 6, 9, 11, 13, 16, 18, 20, 22, 25, 27, 29, 32, 34, 36, 39, 41, $
> 43, 45, 48, 50, 52, 55, 57, 59, 62, 64, 66, 68, 71, 73, 75, 78, 80, 82, 85 ]
> g=[g,87, 89, 91, 94, 96, 98,101,103,105,107,110,112,114,117,119,121,124,126,128, $
> 130,133,135,137,140,142,144,147,149,151,153,156,158,160,163, 165,167,170,172, $
> 174,176,179,181,183,186,188,190,192,195,197,199,202,204,206, 209,211,213,215 ]
> g=[g, 218,220,222,225,227,229,232,234,236,238,241,243,245,248,250, 252,255, $
> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, $
> 0, 0, 0, 0, 0, 2, 9, 15, 21, 28, 34, 41, 47, 53, 60, 66, 73, 79, 85 ]
> g=[g,92, 98,105,111,119,126,132,138,145,151,158,164,170,177,183,190,1 96,203,209, $
> 215,222,228,235,241,247,255, $
> 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 25, 37, 50, 62, 75, 87,100,112,125 ]
> g=[g, 137,150,150,150,150,149,146,144,141,137,127,117,107, 93, 68, 43, 18, 2, 11, $
> 20, 29, 39, 48, 59, 69, 78, 87, 96,106,115,124,133,142,152,161,170,179,189, $
> 198,207,216,226,235,244,255 ]
> b=[ 0, 0, 0, 84,168,255,255,255,220,180,128, 64, 0,190,220,255, $
> 0, 2, 4, 6, 9, 11, 13, 16, 18, 20, 22, 25, 27, 29, 32, 34, 36, 39, 41, $
> 43, 45, 48, 50, 52, 55, 57, 59, 62, 64, 66, 68, 71, 73, 75, 78, 80, 82, 85 ]
> b=[b,87, 89, 91, 94, 96, 98,101,103,105,107,110,112,114,117,119,121,124,126,128, $
> 130,133,135,137,140,142,144,147,149,151,153,156,158,160,163, 165,167,170,172, $
> 174,176,179,181,183,186,188,190,192,195,197,199,202,204,206, 209,211,213,215 ]
> b=[b, 218,220,222,225,227,229,232,234,236,238,241,243,245,248,250, 252,255, $
> 0, 5, 10, 16, 21, 27, 32, 37, 43, 48, 54, 59, 65, 70, 75, 81, 86, 92, 97, $
> 103,108,115,120,126,131,136,142,147,153,158,164,169,174,180, 185,191,196,202 ]
> b=[b, 207,212,218,223,230,236,241,246,252,255,255,255,255,255,255, 255,255,255,255, $
> 255,255,255,255,255,255,255, $
> 0, 8, 16, 25, 33, 41, 50, 58, 66, 75, 83, 91,100,100,100,100,100,100,100 ]
> b=[b, 100,100, 84, 71, 59, 46, 34, 21, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, $
> 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, $
> 0, 0, 0, 0, 0, 0, 0 ]
>
> tvlct, r, g, b
>
> nx = 100
> ny = 100
> pict = dist(100,100)
> contour, pict, /nodata
>
> newx = fix( (!x.crange(1)-!x.crange(0))*!x.s(1)*!d.x_size )
> newy = fix( (!y.crange(1)-!y.crange(0))*!y.s(1)*!d.y_size )
> pix1 = interpolate( pict, (nx-1)*findgen(newx)/(newx-1) ,$
> (ny-1)*findgen(newy)/(newy-1) , /grid)
>
> pix2 = 16+bytscl( pict, top=111 )
> tv, pix2, !x.crange(0), !y.crange(0), /data
>
> oplot, !x.crange, !y.crange, color=12
[Message index]
 
Read Message
Previous Topic: [Q] PLOTS/POLYFILL clipping in map
Next Topic: reading in a series of images

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

Current Time: Thu Oct 09 07:22:48 PDT 2025

Total time taken to generate the page: 1.36323 seconds