Re: time label x axis has one hour shift to the left

From: Arindam Chakraborty <arch13_at_nyahnyahspammersnyahnyah>
Date: Fri Jan 17 2014 - 04:26:39 MST

Hi Jijun and Rick,
 time_axis_labels() is doing the right thing it is supposed to do. Once we
specify %H:00 format, we are forcing the program to print only the hour
value and not the minute. Specifying %H:%M would show the minute as well.
It is not correct to 'truncate' or 'approximate' to the nearest integer
hour in case %H:00 is provided. That'll label both the hour and the minute
wrongly.

 I agree that the selection of values where the ticks should be labeled is
not very smart now. However, using ttmValues one can specify exactly where
the ticks should be given (it works, even for this problem). I'm attaching
the modified test.ncl script. The major change is in the units
specification of 'utc', and addition of ttmValues. Note that, even if we
have specified ttmValues outside the range of the data, the actual tick
marks are only within the range (clipped). Please let me know if you have
any further doubt.

regards,

--
*Dr Arindam Chakraborty*
CAOS, IISc, Bangalore-12
On Fri, Jan 17, 2014 at 12:33 AM, Lijun Diao <ljdiao@gmail.com> wrote:
>   Hi, Rick:
>
> Thanks for pointing out the problem. You suggestion of ttmValues doesn’t
> work. The time labels don’t show up even. I add some dummy values at the
> beginning of the data to make the sharp hour and set the appropriate
> ttmMajorStride value. It looks fine right now. But I have to say it is
> potentially inconvenient in NCL to my knowledge.
>
>  *From:* Rick Brownrigg <brownrig@ucar.edu>
> *Sent:* Thursday, January 16, 2014 11:23 AM
> *To:* Lijun Diao <ljdiao@gmail.com>
> *Cc:* ncl-talk <ncl-talk@ucar.edu>
> *Subject:* Re: [ncl-talk] time label x axis has one hour shift to the left
>
> Hi,
>
> I'm not totally convinced time_axis_labels is doing the right thing in
> this case.  The first time in your data is 13:58:43.  Although the docs for
> time_axis_labels shows an example of using format "%H:00", it looks like it
> takes that value of 13:58:43 and simply makes it "13:00", effectively
> truncating the time value.  Indeed, if I use a format of "%H:%M", the
> plot's labels look correct for the data;  unfortunately they are not at
> nice, top-of-the-hour, intervals.  Check out the ttmValues resource in the
> docs for time_axis_labels for a way to force specific time-values used in
> the labels.
>
> Hope that helps…
> Rick
>
>  On Jan 15, 2014, at 6:53 PM, "Lijun Diao" <ljdiao@gmail.com> wrote:
>
>   Hi, all:
>
> I am trying to plot an xy plot with time label x axis. The time data is
> UTC in secondes. I called “time_axis_labels” precedure. However, it seems
> that the plot is one hour shifted to the left. My first non-missing data
> value begins at 14:01:37 and the last ends at 21:37:13. However, the graph
> shows the time series begins right after 13:00:00 and ends before 21:00:00
> . Please see the attached script, data file and plot.
>
> thanks for any suggestions!
>
>
> -----------------------------------------------------------------------------
> Lijun Diao
> ldiao@uh.edu
> Research Assistant
> Department of Earth & Atmospheric Sciences
> University of Houston
> 4800 Calhoun RD., Bldg. S&R1-312
> Houston, TX 77204-5007
> <test.ncl><test.png><test.txt>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>


_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

Received on Fri Jan 17 04:27:13 2014

This archive was generated by hypermail 2.1.8 : Sun Jan 19 2014 - 21:56:35 MST