Re: x-axis tick mark labels in contour plot

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Thu Jan 26 2012 - 11:33:50 MST

Hi Starry,
Your data file didn't come through so I filled your data array with
random values and ran your script.

In the future when writing to ncl-talk, please mention any errors you
are getting from NCL. In your case you are getting the following error
when you try to set the tmXBLabels:

warning:_NhlCreateSplineCoordApprox: Attempt to create spline
approximation for X axis failed: consider adjusting trXTensionF value
^Mwarning:IrTransInitialize: error creating spline approximation for
trXCoordPoints; defaulting to linear

What this error means is that NCL is having trouble figuring out how to
handle your x-axis coordinate values. So I started to focus on your
input latitudes.

(This turns out not to be the cause of your issue, but you were setting
this:
   lat@units="degrees North"
   lon@units="degrees East"
You were right to set the units attribute of your lat/lon arrays, but
NCL expects them to be one of a few possibilities, the most common one
being:
   lat@units="degrees_north"
   lon@units="degrees_east"

(See this page for more information:
http://www.ncl.ucar.edu/Document/Graphics/error_msg.shtml)

I changed the units attribute and I started getting this warning:
get_lat_values: Warning: Your latitude values do not fall between -90
and 90 inclusive.
You will not get 'nice' latitude labels.

This of course made me really zero in on your latitudes..)

So I printed out your latitudes and longitudes to see what they looked like:
15.0068N 76.9888E
15.0068N 76.9888E
15.0068N 76.9888E
15.0068N 76.9888E
15.0068N 76.9888E
15.0068N 76.9888E
15.0068N 76.9888E
15.0068N 76.9888E
15.0068N 76.9888E
15.0068N 76.9888E
15.0068N 76.9888E
15.0068N 76.9888E
15.0068N 76.9888E
15.0068N 76.9888E
15.0068N 76.9888E
15.0516N 76.9788E
15.0516N 76.9788E
15.0516N 76.9788E
15.0516N 76.9788E
15.0516N 76.9788E
15.0516N 76.9788E
15.0516N 76.9788E
15.0516N 76.9788E

You're plotting latitude vs. height, so the longitudes aren't the issue.
However, as you can see, you have multiple instances of the same
latitude, all with different data values. When you tell NCL to draw a
tickmark at 15.0068N, it doesn't know which point to draw them at, the
1st instance or the 15th instance of 15.0068N... That is definitely the
cause of your X-axis labeling problems, and points to a possible issue
with your data. I'm not sure if the data is the same for each instance
of the same latitude value as I don't have your data. You can get an
idea of that by inserting:
print(lat+"N "+lon+"E "+vfm_swap(0,:))
Good luck,
Adam

On 01/26/2012 08:44 AM, Manoharan, Vani Starry wrote:
> Hi Adam,
>
> I tried runnning the program by not specifying the XBValues/XBLabels. But it generates numbers on the x-axis. I am attaching my program and the data files used in the program with this mail and the following mail (as the files are quite big).
>
> Thank you.
> 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 Thu Jan 26 23:33:59 2012

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