Index: trunk/tools/drawing.py
===================================================================
--- trunk/tools/drawing.py	(revision 557)
+++ trunk/tools/drawing.py	(revision 558)
@@ -1934,4 +1934,5 @@
         mindvals = np.min(vdobj[:])
         maxdvals = np.max(vdobj[:])
+        dimt = len(vvobj[:])
 
         if mindvals < mintval: mintval = mindvals
@@ -1951,5 +1952,5 @@
     timefmt = timevals.split('|')[3]
 
-    dtvals = (maxtval - mintval)/5.
+    dtvals = (maxtval - mintval)/dimt
     tvals = np.arange(mintval, maxtval, dtvals/2.)
 
Index: trunk/tools/drawing_tools.py
===================================================================
--- trunk/tools/drawing_tools.py	(revision 557)
+++ trunk/tools/drawing_tools.py	(revision 558)
@@ -1874,4 +1874,12 @@
         quit()
 
+    secsYear = 365.*24.*3600.
+    secsWeek = 7.*24.*3600.
+    secsDay = 24.*3600.
+    secsHour = 3600.
+    secsMinute = 60.
+    secsMilisecond = 1./1000.
+    secsMicrosecond = 1./1000000.
+
 # Does reference date contain a time value [YYYY]-[MM]-[DD] [HH]:[MI]:[SS]
 ##
@@ -1946,4 +1954,7 @@
     chdate= lastTvec - firstTvec
     chTvec = np.where (chdate != 0., True, False)
+   
+    TOTdt = lastTdt - firstTdt
+    TOTdtsecs = TOTdt.days*secsDay + TOTdt.seconds + TOTdt.microseconds*secsMicrosecond
 
     timeout = []
@@ -1964,26 +1975,26 @@
         basedt = np.zeros((9), dtype=np.float)
         basedt[0] = (365.*100. + 25.)*24.*3600.
-        basedt[1] = 365.*24.*3600.
+        basedt[1] = secsYear
         basedt[2] = 31.*24.*3600.
-        basedt[3] = 7.*24.*3600.
-        basedt[4] = 24.*3600.
-        basedt[5] = 3600.
-        basedt[6] = 60.
+        basedt[3] = secsWeek
+        basedt[4] = secsDay
+        basedt[5] = secsHour
+        basedt[6] = secsMinute
         basedt[7] = 1.
-        basedt[8] = 1000.
+        basedt[8] = secsMilisecond
 
 # Increment according to the units of the CF dates
         if trefunits == 'weeks':
-            basedt = basedt/(7.*24.*3600.)
+            basedt = basedt/(secsWeek)
         elif trefunits == 'days':
-            basedt = basedt/(24.*3600.)
+            basedt = basedt/(secsDay)
         elif trefunits == 'hours':
-            basedt = basedt/(3600.)
+            basedt = basedt/(secsHour)
         elif trefunits == 'minutes':
-            basedt = basedt/(60.)
+            basedt = basedt/(secsMinute)
         elif trefunits == 'seconds':
             basedt = basedt
         elif trefunits == 'milliseconds':
-            basedt = basedt*1000.
+            basedt = basedt*secsMilisecond
 
         if tu == 'c':
@@ -1992,6 +2003,11 @@
             centi = firstTvec[0] / 100
 
-            for it in range((tf - ti)/(Nunits*100) + 1):
-                timeout.append(dt.datetime(centi+it*Nunits*100, 1, 1, 0, 0, 0))
+            datev = firstTdt
+            while datev < lastTdt:
+                yr = datev.year + Nunits*100
+                mon = datev.month
+                datev = dt.datetime(yr, mon, 1, 0, 0, 0)
+                timeout.append(datev)
+
         elif tu == 'y':
             ti = firstTvec[0]
@@ -1999,19 +2015,31 @@
             yeari = firstTvec[0]
 
-            for it in range((tf - ti)/(Nunits) + 1):
-                timeout.append(dt.datetime(yeari+it*Nunits, 1, 1, 0, 0, 0))
+            TOTsteps = int(TOTdtsecs/(Nunits*31*secsDay)) + 1
+
+            datev = firstTdt
+            while datev < lastTdt:
+                yr = datev.year + Nunits
+                mon = datev.month
+                datev = dt.datetime(yr, mon, 1, 0, 0, 0)
+                timeout.append(datev)
+
         elif tu == 'm':
             ti = firstTvec[1]
             tf = lastTvec[1]
+            
             yr = firstTvec[0]
             mon = firstTvec[1]
 
-            for it in range((tf - ti)/(Nunits) + 1):
-                mon = mon+it*Nunits
+            TOTsteps = int(TOTdtsecs/(Nunits*31*secsDay)) + 1
+
+            datev = firstTdt
+            while datev < lastTdt:
+                mon = datev.month + Nunits
                 if mon > 12:
                     yr = yr + 1
                     mon = 1
-
-                timeout.append(dt.datetime(yr, mon, 1, 0, 0, 0))
+                datev = dt.datetime(yr, mon, 1, 0, 0, 0)
+                timeout.append(datev)
+
         elif tu == 'w':
             datev=firstTdt
@@ -2039,4 +2067,5 @@
                 timeout.append(datev)
                 it = it + 1
+
         elif tu == 'h':
             datev=firstTdt
