On Nov 22, 5:06 pm, xiao <littledd...@gmail.com> wrote:
> On Nov 22, 4:27 pm, Reimar Bauer <R.Ba...@fz-juelich.de> wrote:
>
>
>
>> xiao schrieb:
>
>>> On Nov 21, 6:27 pm, David Fanning <n...@dfanning.com> wrote:
>>>> xiao writes:
>>>> > Sorry I have to ask again, i tried to scaled my data, and the result
>>>> > is right, but when I try to plot it, it just show me very few colors
>>>> > (almost bright color) Is it because of my color table? David? Thank
>>>> > you. BTW: i did scale it from 0 to 255.
>>>> Well, I don't think the CONTOUR command knows anything
>>>> about 24-bit colors. He is older, even, than I am. :-)
>
>>>> It's an odd color table, but why don't you just
>>>> load the colors and then tell the Contour command
>>>> to use an index into the color table, like this:
>
>>>> TVLCT, r, g, b
>>>> IF (!D.Flags AND 256) NE 0 THEN $
>>>> Device, Decomposed=0, Get_Decomposed=theState
>>>> CONTOUR, ....., C_Colors=Indgen(64), ....
>>>> IF (!D.Flags AND 256) NE 0 THEN $
>>>> Device, Decomposed=theState
>
>>>> That might work better. At least it is a place to start.
>
>>>> 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.")
>
>>> Sorry, David, it does not work :( I am trying to think where the
>>> problem should be....
>
>> please post a complete example of what you have now. That is easier to
>> understand.
>
>> cheers
>> Reimar
>
> Sorry, here u go, the result is a gray image but I want it from read
> to green :(
>
> numColors = 48
> tvlct, r,g,b,/get
>
> r(0:63)=
> [255,238,221,204,187,170,153,136,119,102,85,68,51,34,17,0,0, 0,0,$
>
> 0,0,0,0,0,7,15,23,31,38,46,54,62,86,110,134,158,182,206,$
>
> 230,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,$
> 255,255,255,255,255,255,255,255,255,255]
>
> g(0:63)=
> [255,238,221,204,187,170,153,136,119,102,85,68,51,34,17,0,0, 0,0,$
>
> 0,0,0,0,0,28,56,84,112,140,168,196,224,227,231,235,239,243,2 47,$
>
> 251,255,249,243,237,232,226,220,214,209,182,156,130,104,78,5 2,$
> 26,0,0,0,0,0,0,0,0,0]
>
> b(0:63)=
> [255,238,221,204,187,170,153,136,119,102,85,68,51,34,17,0,0, 36,$
>
> 72,109,145,182,218,255,223,191,159,127,95,63,31,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,31,63,95,127,159,191,223 ,255]
>
> ; calcualte the true color index of each color defined above
>
> cn = r + 256L * ( g + 256L * b)
>
> help,cn
> min = min(inits)
> max = max(inits)
> inits = (inits-min)/(max-min)
>
> inits = inits*48 + 16
> inits=fix(inits)
> print,max(inits),min(inits)
>
> map_set,/CYLINDRICAL,limit=[-34.3842,min(lon),-31.6985,max
> (lon)],color=0,/noborder
> map_grid, color=0
> map_continents,/countries, /coasts, color=0
>
> contour,inits,color=0,title='Sensible heat flux', /device,/
> NOERASE,xrange=[0,76],/xstyle,xTICKINTERVAL=73,xTICKNAME=[lo n1(0),lon1
> (3)],$
> yrange=[0,73],/ystyle,yTICKINTERVAL=73,yTICKNAME=[lat1(3), lat1(0)],
> $
> C_COLORS=cn,/CELL_FILL, NLEVELS=20
>
> Contour, inits, Color=0, NLEVELS=20,/Overplot
OK, when I using this version, if I put /overplot keyword in the first
contour command, it give me floating errors. If i do not use this key
word, is does not show the TICKNAME of the axies.
numColors = 48
tvlct, r,g,b,/get
r(0:63)=
[255,238,221,204,187,170,153,136,119,102,85,68,51,34,17,0,0, 0,0,$
0,0,0,0,0,7,15,23,31,38,46,54,62,86,110,134,158,182,206,$
230,255,255,255,255,255,255,255,255,255,255,255,255,255,255, 255,$
255,255,255,255,255,255,255,255,255,255]
g(0:63)=
[255,238,221,204,187,170,153,136,119,102,85,68,51,34,17,0,0, 0,0,$
0,0,0,0,0,28,56,84,112,140,168,196,224,227,231,235,239,243,2 47,$
251,255,249,243,237,232,226,220,214,209,182,156,130,104,78,5 2,$
26,0,0,0,0,0,0,0,0,0]
b(0:63)=
[255,238,221,204,187,170,153,136,119,102,85,68,51,34,17,0,0, 36,$
72,109,145,182,218,255,223,191,159,127,95,63,31,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,31,63,95,127,159,191,223 ,255]
min = min(inits)
max = max(inits)
inits = (inits-min)/(max-min)
inits = inits* 255
inits=fix(inits)
print,max(inits),min(inits)
map_set,/CYLINDRICAL,limit=[-34.3842,min(lon),-31.6985,max
(lon)],color=0,/noborder
map_grid, color=0
map_continents,/countries, /coasts, color=0
TVLCT, r, g, b
IF (!D.Flags AND 256) NE 0 THEN $
Device, Decomposed=0, Get_Decomposed=theState
yrange=[0,73],/ystyle,yTICKINTERVAL=73,yTICKNAME=[lat1(3),la t1(0)],
$
C_COLORS=colo,/CELL_FILL, NLEVELS=20
Contour, inits, Color=0, NLEVELS=20,/Overplot
IF (!D.Flags AND 256) NE 0 THEN $
Device, Decomposed=theState
|