Re: plot setting problem

From: Adam Phillips (asphilli AT cgd.ucar.edu)
Date: Mon Aug 15 2005 - 08:50:25 MDT


Hi Jerry,

jerry wrote:
> hi
> if i have a global data T(lat ,lon) and T&lon is between -180~180
> now i want to plot contour map in the domain 150E ~20W 20S~20N
>
> so i set the
>
> res@mpCenterLonF = 180
> res@mpMaxLonF = 200
> res@mpMinLonF = 150
> res@mpMaxLatF = 20
> res@mpMinLatF = -20

I would suggest setting mpCenterLonF = (res@mpMaxLonF+res@mpMinLonF)/2.,
 (= 175), as that would be the center of your longitude range.

res@mpMaxLonF = 200
res@mpMinLonF = 150
res@mpCenterLonF = (res@mpMaxLonF+res@mpMinLonF)/2.
res@mpMaxLatF = 20
res@mpMinLatF = -20

>
> the question is if i writed the code like
> plot = gsn_csm_contour_map(wks, T(ĄG,ĄG), res)
> the label bar's value will show the global domain
> but i just need the value in the range 150E ~20W 20S~20N
> so i change the code to
> plot = gsn_csm_contour_map(wks, T({-20ĄG20},{?ĄG?}), res)
>
> if {?ĄG?} set to {150ĄG200) will got the error message bescause
> T&lon is between -180~180
>
> how can i convert the coordinate variable to fit it or any suggestion
> to change the label bar value ?
>
> Thank you
>

in contributed.ncl there is a function called lonFlip that will flip the
longitudes from 0:360 -> -180:180 or from -180:180 -> 0:360:
http://www.ncl.ucar.edu/Document/Functions/Contributed/lonFlip.shtml

Thus:
T = lonFlip(T)
plot = gsn_csm_contour_map(wks, T({-20ĄG20},{150ĄG200}), res)

Adam
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk@ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
--------------------------------------------------------------
Adam Phillips			             asphilli@ucar.edu
National Center for Atmospheric Research   tel: (303) 497-1726
ESSL/CGD                                   fax: (303) 497-1333
P.O. Box 3000				
Boulder, CO 80307-3000	  http://www.cgd.ucar.edu/cas/asphilli
_______________________________________________
ncl-talk mailing list
ncl-talk@ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk



This archive was generated by hypermail 2b29 : Mon Aug 15 2005 - 09:42:33 MDT