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

Skip to content

Commit b8f5d80

Browse files
committed
Force locator and locator inheritence
1 parent 2855691 commit b8f5d80

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Locators and formatters
2+
~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
Axis locators and formatters must now be subclasses of
5+
`~matplotlib.ticker.Locator` and `~matplotlib.ticker.Formatter` respectively.

lib/matplotlib/axis.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -577,10 +577,8 @@ def locator(self):
577577
@locator.setter
578578
def locator(self, locator):
579579
if not isinstance(locator, mticker.Locator):
580-
cbook.warn_deprecated(
581-
"3.2", message="Support for locators that do not subclass "
582-
"matplotlib.ticker.Locator is deprecated since %(since)s and "
583-
"support for them will be removed %(removal)s.")
580+
raise TypeError('locator must be a subclass of '
581+
'matplotlib.ticker.Locator')
584582
self._locator = locator
585583

586584
@property
@@ -590,10 +588,8 @@ def formatter(self):
590588
@formatter.setter
591589
def formatter(self, formatter):
592590
if not isinstance(formatter, mticker.Formatter):
593-
cbook.warn_deprecated(
594-
"3.2", message="Support for formatters that do not subclass "
595-
"matplotlib.ticker.Formatter is deprecated since %(since)s "
596-
"and support for them will be removed %(removal)s.")
591+
raise TypeError('formatter must be a subclass of '
592+
'matplotlib.ticker.Formatter')
597593
self._formatter = formatter
598594

599595

0 commit comments

Comments
 (0)