Re: x-axis tick mark labels in contour plot

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Tue Jan 24 2012 - 15:08:48 MST

Hi Starry,
When this type of thing happens it is usually a mismatch between the
X-axis range supplied via a coordinate variable in your gsn_csm_contour
(or gsn_csm_pres_hgt) plot call and the X-axis values you are giving.

For instance, if I have an array that looks like this:

Variable: arr
Type: float
Total Size: 8448 bytes
             2112 values
Number of Dimensions: 2
Dimensions and sizes: [lev | 11] x [lat | 192]
Coordinates:
             lev: [1000..100]
             lat: [ -90.. 90]

and then I do this:
plot = gsn_csm_pres_hgt(wks,arr,False)

then I know that the Y-axis will go from 1000-100hPa and the x-axis will
go from 90S-90N. If I decide to specify tmXBMode = "Explicit" and
tmXBValues I would need to make sure that the values I am passing
tmXBValues fall within the range from -90 to 90.

Try not specifying the XBValues/XBLabels and see what happens.
Alternatively do a printVarSummary of the array you pass into
gsn_csm_pres_hgt and see what coordinate variable (if any) is present
for the 2nd dimension of your data.

I would venture to guess that a latitude coordinate variable isn't
present in your plotting array. If that's the case, you should attach
your lat1d array to your plotting array: (assuming you plotting array is
named "arr")
arr!1 = "lat"
arr&lat = lat1d

Hope that helps. If not, please respond to ncl-talk with a
printVarSummary of your plotting array along with a copy of your code.
Adam

On 01/24/2012 02:43 PM, Manoharan, Vani Starry wrote:
> Hi,
>
> I am trying to do a contour plot. The data is two dimension. The y-axis is altitude and x-axis is latitude. My y-axis tick marks gets labled properly. However my x-axis tick marks lables are written one on top of the other (please see attached figure). I tried all possibilities and could not figure out. I would appreciate your help here.
>
> Here is the part of my program that I use to lable my tick marks.
>
> ;---Tickmark resources
>
> latstep = 73
> res@tmXBMode = "Explicit"
>
> res@tmXBValues = lat1d(::latstep)
>
> res@tmXBLabels = sprintf("%5.2f",lat1d(::latstep)) + "~C~" + \
>
> sprintf("%5.2f",lon1d(::latstep))
>
> res@tmXBLabelFontHeightF = 0.01
>
> res@tmEqualizeXYSizes = True ; make sure labels same size
>
>
>
> Thanks in advance.
>
> Starry
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
______________________________________________________________
Adam Phillips                                asphilli@ucar.edu
NCAR/Climate and Global Dynamics Division       (303) 497-1726
P.O. Box 3000				
Boulder, CO 80307-3000    http://www.cgd.ucar.edu/cas/asphilli

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Jan 25 03:08:58 2012

This archive was generated by hypermail 2.1.8 : Thu Feb 02 2012 - 03:10:31 MST