Re: Why the contour does not show? [message #63871] |
Fri, 21 November 2008 12:19  |
xiao zhang
Messages: 81 Registered: June 2008
|
Member |
|
|
On Nov 21, 2:02 pm, David Fanning <n...@dfanning.com> wrote:
> xiao writes:
>> ........Hmmm......seems it will take a lot of time for me to
>> correct.... :)
>
> It depends on how fast you can read. :-)
>
> I'd start here:
>
> http://www.dfanning.com/tips/ps_colorswitch.html
>
> And then, go here:
>
> http://www.dfanning.com/tips/nlevels.html
>
> 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.")
Thanks David. These are useful. And I also found another mistake,
because the X,Y range are out of the display so it does not show the
data. Now, I am trying to put it in a map projection an d fill the
color......
|
|
|
|
Re: Why the contour does not show? [message #63873 is a reply to message #63872] |
Fri, 21 November 2008 11:48   |
xiao zhang
Messages: 81 Registered: June 2008
|
Member |
|
|
On Nov 21, 1:32 pm, David Fanning <n...@dfanning.com> wrote:
> xiao writes:
>> Hi~ guys. I have a problem here. I have a small program doing a
>> contour plot. But is just show me the background, not the data. I
>> guess there is something wrong with the colors. Can anyone help?
>> Thanks
>
>> lat=fltarr(75)
>> lon=fltarr(75)
>
>> latstep=(34.3842-31.6985)/74.0
>> lonstep=(121.5581-118.3524)/74.0
>
>> for i=0,74 do begin
>> lat(i)=-31.6985-i*latstep
>> lon(i)=118.3524+i*lonstep
>> endfor
>
>> print,max(lat),min(lat)
>> print,max(lon),min(lon)
>
>> device,decomposed=0
>> !p.background = 255
>> xs=600
>> ys=600
>> window,xsize=xs,ysize=ys
>
>> contour,inits,color=0,xrange=[min(lon),max(lon)],yrange=[min (lat),max
>> (lat)],xtitle='longtitude',ytitle='latitude',title='Sensible heat
>> flux'
>
> I'm going to guess this is because you are doing this
> in PostScript and you are drawing white on white. There
> are lots of articles to read on my web page about PostScript,
> contour plots, and colors. You are making nearly every mistake. :-)
>
> 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.")
........Hmmm......seems it will take a lot of time for me to
correct.... :)
|
|
|
Re: Why the contour does not show? [message #63874 is a reply to message #63873] |
Fri, 21 November 2008 11:32   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
xiao writes:
> Hi~ guys. I have a problem here. I have a small program doing a
> contour plot. But is just show me the background, not the data. I
> guess there is something wrong with the colors. Can anyone help?
> Thanks
>
> lat=fltarr(75)
> lon=fltarr(75)
>
> latstep=(34.3842-31.6985)/74.0
> lonstep=(121.5581-118.3524)/74.0
>
> for i=0,74 do begin
> lat(i)=-31.6985-i*latstep
> lon(i)=118.3524+i*lonstep
> endfor
>
> print,max(lat),min(lat)
> print,max(lon),min(lon)
>
> device,decomposed=0
> !p.background = 255
> xs=600
> ys=600
> window,xsize=xs,ysize=ys
>
>
> contour,inits,color=0,xrange=[min(lon),max(lon)],yrange=[min (lat),max
> (lat)],xtitle='longtitude',ytitle='latitude',title='Sensible heat
> flux'
I'm going to guess this is because you are doing this
in PostScript and you are drawing white on white. There
are lots of articles to read on my web page about PostScript,
contour plots, and colors. You are making nearly every mistake. :-)
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.")
|
|
|
|