Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 44d503e

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

File tree

Expand file treeCollapse file tree

2 files changed

+7
-21
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+7
-21
lines changed

‎doc/api/prev_api_changes/api_changes_3.1.0.rst

Copy file name to clipboardExpand all lines: doc/api/prev_api_changes/api_changes_3.1.0.rst
-4Lines 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

Copy file name to clipboardExpand all lines: lib/matplotlib/ticker.py
+7-17Lines changed: 7 additions & 17 deletions
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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.