[ncl-talk] Plot time axis in yyyymmddhh

Mary Haley haley at ucar.edu
Sat Oct 11 17:24:03 MDT 2014


Partha,

The problem is that you are using values like this on the X axis:

(155) 2014092809
(156) 2014092812
(157) 2014092815
(158) 2014092818
(159) 2014092821
(160) 2014092900
(161) 2014092903
(162) 2014092906

This is going to cause erratic spacing on the X axis. Try using
yyyymmddhh_to_yyfrac to convert to year fractions, and then plot against
that array instead of time:

   time_frac = yyyymmddhh_to_yyyyfrac(time,0)
. . .
      res at tmXBValues = time_frac(::8) ; Label every 8th one

. . .
      plot = gsn_csm_xy (wks,time_frac,p1,res)

--Mary

On Thu, Oct 9, 2014 at 12:14 PM, Partha Bhattacharjee <pbhatta2 at jhu.edu>
wrote:

>  I am using NCL 6.2.1 and trying to plot a time series over a location
> (total 240 points). Input data (at regular 3 hour intervals for an entire
> month)  is 2d (lat,lon) with no time dimension. I created a time stamp of
> yyyymmddhh and extract only day and hour part. However, when I am trying to
> plot it using xy plot it does not show anything on the x-axis and plot also
> limited to middle part.
>
> Any help. Attached is the code, sample input file and output figure.
>
>
>   Thanks in advance.
>
> Partha
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20141011/802f9baa/attachment.html 


More information about the ncl-talk mailing list