<div dir="ltr"><div class="gmail_default" style="font-size:small">It looks like you have a "curvilinear" lat/lon grid and not a "rectilinear" one. This means that you have 2D lat/lon arrays, instead of 1D lat/lon arrays that are attached to your data as coordinate arrays.</div>
<div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Whenever you have 2D coordinate locations and you create a regular contour plot that's not over a map, your X (or Y) axis can't be labeled with a single line of labels, because whatever labels may represent one row of your data is not going to represent the second, third, or later rows of your data.</div>
<div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">If you really need to see latitude values on the X axis, you will need to regrid your data to a rectilinear grid first.</div>
<div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Also, you are subscripting the array with the value "100". Note that this is going to be an index value, and not "longitude=100", because again, you have 2D lat/lon values, so you can't guarantee that this slice represents the same longitude value across all latitudes.</div>
<div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">--Mary</div><div class="gmail_default" style="font-size:small"><br></div></div><div class="gmail_extra"><br><br>
<div class="gmail_quote">On Thu, Aug 28, 2014 at 4:55 PM, <span dir="ltr"><<a href="mailto:cfdierking@alaska.edu" target="_blank">cfdierking@alaska.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Below is a simple script for plotting a cross-section from a NARR grib file.<br>
It runs fine, but the result always plots the index number of the grid on the<br>
X-scale. What would I need to do to plot latitude on the X-scale?<br>
<br>
;***********************<br>
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"<br>
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"<br>
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"<br>
;===========================<br>
begin<br>
fnm = "merged_AWIP32.<a href="tel:2013082200" value="+12013082200">2013082200</a>.3D.grb" ; filename<br>
<br>
f = addfile (fnm , "r") ; add file<br>
u = f->U_GRD_221_ISBL ; get u for January<br>
lat2d = f->gridlat_221<br>
u@lat2d = lat2d<br>
<br>
wks = gsn_open_wks ("ps", "h_lat" ) ; open workstation<br>
; ===========================<br>
; Create a default plot<br>
; ===========================<br>
printVarSummary(u)<br>
plot = gsn_csm_pres_hgt(wks, u(:,100,:), False )<br>
<br>
end<br>
;*****************************<br>
;*****************************<br>
<br>
Here is the output of the "printVarSummary" for the variable "u"...<br>
<br>
Variable: u<br>
Type: float<br>
Total Size: 11214068 bytes<br>
2803517 values<br>
Number of Dimensions: 3<br>
Dimensions and sizes: [lv_ISBL0 | 29] x [gridx_221 | 277] x [gridy_221 |<br>
349]<br>
Coordinates:<br>
lv_ISBL0: [100..1000]<br>
Number Of Attributes: 15<br>
lat2d : <ARRAY of 96673 elements><br>
sub_center : The North American Regional Reanalysis (NARR) Project<br>
center : US National Weather Service - NCEP (WMC)<br>
long_name : u-component of wind<br>
units : m/s<br>
_FillValue : 1e+20<br>
coordinates : gridlat_221 gridlon_221<br>
level_indicator : 100<br>
grid_number : 221<br>
parameter_table_version : 131<br>
parameter_number : 33<br>
model : North American Regional Reanalysis (NARR)<br>
forecast_time : 0<br>
forecast_time_units : hours<br>
initial_time : 08/22/2013 (00:00)<br>
_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
</blockquote></div><br></div>