8000 Merge pull request #13992 from jklymak/fix-undeprecate-MaxNLocator-de… · matplotlib/matplotlib@44d503e · GitHub
[go: up one dir, main page]

Skip to content

Commit 44d503e

Browse files
authored
Merge pull request #13992 from jklymak/fix-undeprecate-MaxNLocator-default_params
FIX: undeprecate MaxNLocator default_params
2 parents 4f76f04 + 50a1808 commit 44d503e

File tree

2 files changed

+7
-21
lines changed

2 files changed

+7
-21
lines changed

doc/api/prev_api_changes/api_changes_3.1.0.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -938,10 +938,6 @@ classes, whose constructors take a *base* argument.
938938
Locators / Formatters
939939
~~~~~~~~~~~~~~~~~~~~~
940940

941-
- `matplotlib.ticker.MaxNLocator.default_params` class variable
942-
943-
The defaults are not supposed to be user-configurable.
944-
945941
- ``OldScalarFormatter.pprint_val``
946942
- ``ScalarFormatter.pprint_val``
947943
- ``LogFormatter.pprint_val``

lib/matplotlib/ticker.py

Lines changed: 7 additions & 17 deletions
53BF
Original file line numberDiff line numberDiff line change
@@ -1883,12 +1883,12 @@ class MaxNLocator(Locator):
18831883
"""
18841884
Select no more than N intervals at nice locations.
18851885
"""
1886-
_default_params = dict(nbins=10,
1887-
steps=None,
1888-
integer=False,
1889-
symmetric=False,
1890-
prune=None,
1891-
min_n_ticks=2)
1886+
default_params = dict(nbins=10,
1887+
steps=None,
1888+
integer=False,
1889+
symmetric=False,
1890+
prune=None,
1891+
min_n_ticks=2)
18921892

18931893
def __init__(self, *args, **kwargs):
18941894
"""
@@ -1940,7 +1940,7 @@ def __init__(self, *args, **kwargs):
19401940
if len(args) > 1:
19411941
raise ValueError(
19421942
"Keywords are required for all arguments except 'nbins'")
1943-
self.set_params(**{**self._default_params, **kwargs})
1943+
self.set_params(**{**self.default_params, **kwargs})
19441944

19451945
@staticmethod
19461946
def _validate_steps(steps):
@@ -1957,16 +1957,6 @@ def _validate_steps(steps):
19571957
steps = np.hstack((steps, 10))
19581958
return steps
19591959

1960-
@cbook.deprecated("3.1")
1961-
@property
1962-
def default_params(self):
1963-
return self._default_params
1964-
1965-
@cbook.deprecated("3.1")
1966-
@default_params.setter
1967-
def default_params(self, params):
1968-
self._default_params = params
1969-
19701960
@staticmethod
19711961
def _staircase(steps):
19721962
# Make an extended staircase within which the needed

0 commit comments

Comments
 (0)
0