|
From: | Ozzy Lash |
Subject: | Re: How to inspect Datenum code |
Date: | Wed, 6 Sep 2017 17:11:40 -0500 |
On Wed, Sep 06, 2017 at 13:56:35 -0700, gciriani wrote:
> Do you mean a fixed datenum or a fixed datetick? To me it seems a datetick
> bug.
No, the bug is in datenum.
The datetick function figures out how to divide the time range into some
number of ticks.
When the time span is less than 3 months, it is divided evenly into some
intervals that make sense.
When the time span is more than 3 months, as in your example, it
attempts to divide the span into even intervals and may end up passing a
fractional month number into datenum to calculate those values.
The datenum function is now fixed to allow fractional month numbers when
given an array of time values, as in
datenum ([2017 1 1; 2017 1.5 1; 2017 2 1])
This makes calculating ranges across some span of months easier.
If you want to work around this in Octave 4.2.1, you can use the
"keepticks" option to the datetick function to prevent it from
recalculating the tick intervals.
--
mike
[Prev in Thread] | Current Thread | [Next in Thread] |