octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #39727] datetick gives ..., 1699, 1720, ...


From: Marco Caliari
Subject: [Octave-bug-tracker] [bug #39727] datetick gives ..., 1699, 1720, ...
Date: Fri, 09 Aug 2013 07:45:34 +0000
User-agent: Mozilla/5.0 (X11; Linux i686; rv:13.0) Gecko/20100101 Firefox/13.0

Follow-up Comment #1, bug #39727 (project octave):

I confirm this behavior for 3.6.2. The problem is around line 195 of
datetick.m. The separation sep is computed from minyear and maxyear (line
189), but the ticks are computed from the corresponding datenum. But, because
of leap years (I think), the original separation (20 in this case) is lost.
So, the ticks should be computed in the same if branch.


sep = __calc_tick_sep__ (minyear , maxyear);
xmin = datenum (sep * floor (minyear / sep), 1, 1);
xmax = datenum (sep * ceil (maxyear / sep), 1, 1);
nticks = ceil (maxyear / sep) - floor (minyear / sep) + 1;
[minyear, ~] = datevec (xmin);
[maxyear, ~] = datevec (xmax);
rangeyear = (minyear:sep:maxyear)';
ticks = datenum([rangeyear,ones(rows(rangeyear),2)]);


I think a similar problem should occur when computing separations between
months (previous if branch).

Marco

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?39727>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]