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

Skip to content

Commit 917de33

Browse files
jrmlhermitteJulien L
authored andcommitted
added TypeError exception handling to setting x/ylim
1 parent 479d68f commit 917de33

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

lib/matplotlib/axes/_base.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -997,7 +997,10 @@ def cla(self):
997997
self.xaxis.set_minor_locator(minl)
998998
else:
999999
self.xaxis._set_scale('linear')
1000-
self.set_xlim(0, 1)
1000+
try:
1001+
self.set_xlim(0, 1)
1002+
except TypeError:
1003+
pass
10011004

10021005
if self._sharey is not None:
10031006
self.yaxis.major = self._sharey.yaxis.major
@@ -1021,7 +1024,10 @@ def cla(self):
10211024
self.yaxis.set_minor_locator(minl)
10221025
else:
10231026
self.yaxis._set_scale('linear')
1024-
self.set_ylim(0, 1)
1027+
try:
1028+
self.set_ylim(0, 1)
1029+
except TypeError:
1030+
pass
10251031

10261032
# update the minor locator for x and y axis based on rcParams
10271033
if (rcParams['xtick.minor.visible']):

0 commit comments

Comments
 (0)