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

Skip to content

Commit 79acf30

Browse files
committed
Add nonsingular handling for nans/infs
1 parent 6351e7b commit 79acf30

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/matplotlib/dates.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1228,6 +1228,8 @@ def tick_values(self, vmin, vmax):
12281228
return self.get_locator(vmin, vmax).tick_values(vmin, vmax)
12291229

12301230
def nonsingular(self, vmin, vmax):
1231+
if not np.isfinite(vmin) or not np.isfinite(vmax):
1232+
return 1, 2 # initial range, no data plotted yet
12311233
# whatever is thrown at us, we can scale the unit.
12321234
# But default nonsingular date plots at an ~4 year period.
12331235
if vmin == vmax:

0 commit comments

Comments
 (0)