| 1478 | self.base = ticker._Edge_integer(base, 0) |
| 1479 | |
| 1480 | def _create_rrule(self, vmin, vmax): |
| 1481 | # 'start' needs to be a multiple of the interval to create ticks on |
| 1482 | # interval multiples when the tick frequency is YEARLY |
| 1483 | ymin = max(self.base.le(vmin.year) * self.base.step, 1) |
| 1484 | ymax = min(self.base.ge(vmax.year) * self.base.step, 9999) |
| 1485 | |
| 1486 | c = self.rule._construct |
| 1487 | replace = {'year': ymin, |
| 1488 | 'month': c.get('bymonth', 1), |
| 1489 | 'day': c.get('bymonthday', 1), |
| 1490 | 'hour': 0, 'minute': 0, 'second': 0} |
| 1491 | |
| 1492 | start = vmin.replace(**replace) |
| 1493 | stop = start.replace(year=ymax) |
| 1494 | self.rule.set(dtstart=start, until=stop) |
| 1495 | |
| 1496 | return start, stop |
| 1497 | |
| 1498 | |
| 1499 | class MonthLocator(RRuleLocator): |