Skip to content

Commit 0810891

Browse files
committed
MNT: change default dates to 1970-01-01 to -02
1 parent d73ba9e commit 0810891

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

lib/matplotlib/dates.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -1157,9 +1157,9 @@ def nonsingular(self, vmin, vmax):
11571157
if it is too close to being singular (i.e. a range of ~0).
11581158
"""
11591159
if not np.isfinite(vmin) or not np.isfinite(vmax):
1160-
# Except if there is no data, then use 2000-2010 as default.
1161-
return (date2num(datetime.date(2000, 1, 1)),
1162-
date2num(datetime.date(2010, 1, 1)))
1160+
# Except if there is no data, then use 1970 as default.
1161+
return (date2num(datetime.date(1970, 1, 1)),
1162+
date2num(datetime.date(1970, 1, 2)))
11631163
if vmax < vmin:
11641164
vmin, vmax = vmax, vmin
11651165
unit = self._get_unit()
@@ -1362,9 +1362,9 @@ def nonsingular(self, vmin, vmax):
13621362
# whatever is thrown at us, we can scale the unit.
13631363
# But default nonsingular date plots at an ~4 year period.
13641364
if not np.isfinite(vmin) or not np.isfinite(vmax):
1365-
# Except if there is no data, then use 2000-2010 as default.
1366-
return (date2num(datetime.date(2000, 1, 1)),
1367-
date2num(datetime.date(2010, 1, 1)))
1365+
# Except if there is no data, then use 1970 as default.
1366+
return (date2num(datetime.date(1970, 1, 1)),
1367+
date2num(datetime.date(1970, 1, 2)))
13681368
if vmax < vmin:
13691369
vmin, vmax = vmax, vmin
13701370
if vmin == vmax:
@@ -1850,8 +1850,8 @@ def axisinfo(self, unit, axis):
18501850
majloc = AutoDateLocator(tz=tz,
18511851
interval_multiples=self._interval_multiples)
18521852
majfmt = AutoDateFormatter(majloc, tz=tz)
1853-
datemin = datetime.date(2000, 1, 1)
1854-
datemax = datetime.date(2010, 1, 1)
1853+
datemin = datetime.date(1970, 1, 1)
1854+
datemax = datetime.date(1970, 1, 2)
18551855

18561856
return units.AxisInfo(majloc=majloc, majfmt=majfmt, label='',
18571857
default_limits=(datemin, datemax))
@@ -1907,8 +1907,8 @@ def axisinfo(self, unit, axis):
19071907
zero_formats=self._zero_formats,
19081908
offset_formats=self._offset_formats,
19091909
show_offset=self._show_offset)
1910-
datemin = datetime.date(2000, 1, 1)
1911-
datemax = datetime.date(2010, 1, 1)
1910+
datemin = datetime.date(1970, 1, 1)
1911+
datemax = datetime.date(1970, 1, 2)
19121912
return units.AxisInfo(majloc=majloc, majfmt=majfmt, label='',
19131913
default_limits=(datemin, datemax))
19141914

0 commit comments

Comments
 (0)