MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / _create_rrule

Method _create_rrule

lib/matplotlib/dates.py:1480–1496  ·  view source on GitHub ↗
(self, vmin, vmax)

Source from the content-addressed store, hash-verified

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
1499class MonthLocator(RRuleLocator):

Callers

nothing calls this directly

Calls 4

leMethod · 0.80
geMethod · 0.80
getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected