Skip to content

Commit 035bf30

Browse files
authored
Merge pull request #18203 from dstansby/tick-form-depr
Force locator and formatter inheritence
2 parents 207433a + b8f5d80 commit 035bf30

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed
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)