On Nov 21, 4:16 pm, David Fanning <n...@dfanning.com> wrote:
> xiao writes:
>> haha. That is fine, David, But another problem arouse, When I plot
>> like this:
>
>> map_set,limit=[-34.3842,min(lon),-31.6985,max(lon)], /noborder,color=0
>> map_grid, color=0,/label
>> map_continents,/countries, /coasts, color=0
>> contour,inits,color=0,xtitle='longtitude',ytitle='latitude', title='Sensible
>> heat flux', /device, /CELL_FILL, /Overplot
>
>> It showed the map, but also, it gave me an error:
>
>> Program caused arithmetic error: Floating underflow
>
>> Is it because my data is larger than the map or something?
>
> Oh, underflows can come from a lot of things. The chances
> are, however, that it is not something to worry over
> excessively:
>
> http://www.dfanning.com/math_tips/underflow.html
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
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.
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)
max = max(inits)
inits = (inits-min)/(max-min)
;print,inits
inits = inits*255
inits=fix(inits) ;Scale
map_set,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),la t1(0)],
$
C_COLORS=cn,/CELL_FILL
screenimg = tvrd(true=1)
write_jpeg, 'jja.jpg', screenimg, true=1
end
|