diff scripts/time/datetick.m @ 14665:4f458e882516

Allow fractional months to datenum and correct a couple of typos in datetick (bug #36482)
author David Bateman <dbateman@free.fr>
date Mon, 21 May 2012 00:40:44 +0200
parents 86854d032a37
children 460a3c6d8bf1
line wrap: on
line diff
--- a/scripts/time/datetick.m
+++ b/scripts/time/datetick.m
@@ -159,7 +159,7 @@
       ## Day scale or less
       if (xmax - xmin < N / 24 / 60 / 60)
         scl = 1 / 24 / 60 / 60;
-      elseif (xmax - xmin < N / 24 / 6)
+      elseif (xmax - xmin < N / 24 / 60)
         scl = 1 / 24 / 60;
       else
         scl = 1 / 24;
@@ -186,7 +186,7 @@
       elseif (maxyear - minyear < N)
         sep = __calc_tick_sep__ (minmonth , maxmonth);
         xmin = datenum (ymin, sep * floor (minmonth / sep), 1);
-        xmax = datenum (ymin, sep * ceil (maxmonth / sep), 1);
+        xmax = datenum (ymax, sep * ceil (maxmonth / sep), 1);
         nticks = ceil (maxmonth / sep) - floor (minmonth / sep) + 1;
       else
         sep = __calc_tick_sep__ (minyear , maxyear);