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

Skip to content

Commit a6651fe

Browse files
committed
FIX: back to isinstance
1 parent 769cfb8 commit a6651fe

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/matplotlib/axis.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1568,7 +1568,7 @@ def set_major_formatter(self, formatter):
15681568
15691569
ACCEPTS: A :class:`~matplotlib.ticker.Formatter` instance
15701570
"""
1571-
if not hasattr(formatter, 'format_data'):
1571+
if not isinstance(formatter, mticker.Formatter):
15721572
raise TypeError("formatter argument should be instance of "
15731573
"matplotlib.ticker.Formatter")
15741574
self.isDefault_majfmt = False
@@ -1582,7 +1582,7 @@ def set_minor_formatter(self, formatter):
15821582
15831583
ACCEPTS: A :class:`~matplotlib.ticker.Formatter` instance
15841584
"""
1585-
if not hasattr(formatter, 'format_data'):
1585+
if not isinstance(formatter, mticker.Formatter):
15861586
raise TypeError("formatter argument should be instance of "
15871587
"matplotlib.ticker.Formatter")
15881588
self.isDefault_minfmt = False
@@ -1596,7 +1596,7 @@ def set_major_locator(self, locator):
15961596
15971597
ACCEPTS: a :class:`~matplotlib.ticker.Locator` instance
15981598
"""
1599-
if not hasattr(locator, 'tick_values'):
1599+
if not isinstance(locator, mticker.Locator):
16001600
raise TypeError("formatter argument should be instance of "
16011601
"matplotlib.ticker.Locator")
16021602
self.isDefault_majloc = False
@@ -1610,7 +1610,7 @@ def set_minor_locator(self, locator):
16101610
16111611
ACCEPTS: a :class:`~matplotlib.ticker.Locator` instance
16121612
"""
1613-
if not hasattr(locator, 'tick_values'):
1613+
if not isinstance(locator, mticker.Locator):
16141614
raise TypeError("formatter argument should be instance of "
16151615
"matplotlib.ticker.Locator")
16161616
self.isDefault_minloc = False

0 commit comments

Comments
 (0)