Browse Source

Fix https://github.com/src-d/hercules/issues/190

Signed-off-by: egor <egor@sourced.tech>
egor 6 years ago
parent
commit
65e4f297f2
1 changed files with 1 additions and 1 deletions
  1. 1 1
      labours.py

+ 1 - 1
labours.py

@@ -1350,7 +1350,7 @@ def show_devs(args, name, start_date, end_date, data):
     interval = int(numpy.ceil(num_months / target_num_labels))
     if interval >= 8:
         interval = int(numpy.ceil(num_months / (12 * target_num_labels)))
-        axes[-1].xaxis.set_major_locator(matplotlib.dates.YearLocator(interval=interval))
+        axes[-1].xaxis.set_major_locator(matplotlib.dates.YearLocator(base=max(1, interval // 12)))
         axes[-1].xaxis.set_major_formatter(matplotlib.dates.DateFormatter("%Y"))
     else:
         axes[-1].xaxis.set_major_locator(matplotlib.dates.MonthLocator(interval=interval))