Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1cd2ddc

Browse files
committed
make interval_multiples work for years
1 parent 2fd479a commit 1cd2ddc

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

lib/matplotlib/dates.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,15 +1189,15 @@ def get_locator(self, dmin, dmax):
11891189
else:
11901190
byranges[i] = self._byranges[i]
11911191

1192-
# We found what frequency to use
11931192
break
11941193
else:
11951194
raise ValueError('No sensible date limit could be found in the '
11961195
'AutoDateLocator.')
11971196

1198-
if use_rrule_locator[i]:
1197+
if (freq == YEARLY) and self.interval_multiples:
1198+
locator = YearLocator(interval)
1199+
elif use_rrule_locator[i]:
11991200
_, bymonth, bymonthday, byhour, byminute, bysecond, _ = byranges
1200-
12011201
rrule = rrulewrapper(self._freq, interval=interval,
12021202
dtstart=dmin, until=dmax,
12031203
bymonth=bymonth, bymonthday=bymonthday,

0 commit comments

Comments
 (0)