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

Method nonsingular

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

Source from the content-addressed store, hash-verified

1326 return self.get_locator(vmin, vmax).tick_values(vmin, vmax)
1327
1328 def nonsingular(self, vmin, vmax):
1329 # whatever is thrown at us, we can scale the unit.
1330 # But default nonsingular date plots at an ~4 year period.
1331 if not np.isfinite(vmin) or not np.isfinite(vmax):
1332 # Except if there is no data, then use 1970 as default.
1333 return (date2num(datetime.date(1970, 1, 1)),
1334 date2num(datetime.date(1970, 1, 2)))
1335 if vmax < vmin:
1336 vmin, vmax = vmax, vmin
1337 if vmin == vmax:
1338 vmin = vmin - DAYS_PER_YEAR * 2
1339 vmax = vmax + DAYS_PER_YEAR * 2
1340 return vmin, vmax
1341
1342 def _get_unit(self):
1343 if self._freq in [MICROSECONDLY]:

Callers

nothing calls this directly

Calls 1

date2numFunction · 0.85

Tested by

no test coverage detected