[ncl-talk] Hovmueller plot, x axis range adjustment

Adam Phillips asphilli at ucar.edu
Fri Aug 31 15:28:28 MDT 2018


Hi Toni,
Thanks for sending a clean script and the data file as that made diagnosing
the issue easier. When you call the gsn_csm_hov plotting function and pass
in your data array (in your script named data_00), NCL will look at the
coordinate variables attached to the 2 dimensions for information on how to
display the data. If NCL does not find any coordinate variables, it will
label the corresponding axis starting at 0. Looking at your data_00 array:
Variable: data_00
Type: float
Total Size: 6800 bytes
            1700 values
Number of Dimensions: 2
Dimensions and sizes: [year | 85] x [lon_zones | 20]
Coordinates:
            year: [2015..2099]
Number Of Attributes: 3
  units : %
  long_name : Grassland percentage of total area in latitude zone 1
  _FillValue : 9.96921e+36

The 1st dimension is shown as have a coordinate variable (named year), but
the 2nd dimension does not. (Note that the second dimension is named
lon_zones though.) To solve the problem you need to attach the lon_zones
array from the input .nc file as a coordinate variable to your data_00
array:
data_00&lon_zones = MC2_f->lon_zones

If you have further questions let ncl-talk know.
Adam



On Fri, Aug 31, 2018 at 3:15 PM Toni Klemm <toni-klemm at tamu.edu> wrote:

> Hello all,
>
> I'm trying to plot a time series of data in the form of a Hovmueller plot.
> However, I have trouble adjusting the x axis such that it shows the range
> of longitudes correctly. Instead of the longitude range, -105 to -95
> degrees East in 0.5 degrees increments, it shows a range from 0 to 18 on
> the x axis of the plot. Longitudes are included in the netCDF file as
> variable “lon_zones”. I tried to adjust the x axis range manually using
> res at trXMinF and res at trXMaxF, but I got this error message:
>
> warning:ContourPlotSetValues: X coordinates out of data range: defaulting
>
> I used example 5 here (
> https://www.ncl.ucar.edu/Applications/time_lon.shtml) as a template, but
> I didn’t find an explanation for how the x axis shows longitudes there.
>
> Any help would be much appreciated!
>
> I attached the netCDF file, the plot, and my script.
>
> Thank you,
> Toni
>
>
>
>
> *Toni Klemm, Ph.D.*Postdoctoral Research Associate
> Department of Ecosystem Science and Management
> College of Agriculture and Life Sciences
> Texas A&M University, College Station, TX
> Contributor to the Early Career Climate Forum <http://www.eccforum.org>
> www.toni-klemm.de | @toniklemm <http://twitter.com/toniklemm>
>
>
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>


-- 
Adam Phillips
Associate Scientist,  Climate and Global Dynamics Laboratory, NCAR
www.cgd.ucar.edu/staff/asphilli/   303-497-1726

<http://www.cgd.ucar.edu/staff/asphilli>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180831/b7d0649f/attachment.html>


More information about the ncl-talk mailing list