10000 Backport PR #13992 on branch v3.1.x (FIX: undeprecate MaxNLocator default_params) by meeseeksmachine · Pull Request #13999 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Backport PR #13992 on branch v3.1.x (FIX: undeprecate MaxNLocator default_params) #13999

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions doc/api/prev_api_changes/api_changes_3.1.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -938,10 +938,6 @@ classes, whose constructors take a *base* argument.
Locators / Formatters
~~~~~~~~~~~~~~~~~~~~~

- `matplotlib.ticker.MaxNLocator.default_params` class variable

The defaults are not supposed to be user-configurable.

- ``OldScalarFormatter.pprint_val``
- ``ScalarFormatter.pprint_val``
- ``LogFormatter.pprint_val``
Expand Down
24 changes: 7 additions & 17 deletions lib/matplotlib/ticker.py
Original file line number Diff line number Diff line change
Expand Up @@ -1883,12 +1883,12 @@ class MaxNLocator(Locator):
"""
Select no more than N intervals at nice locations.
"""
_default_params = dict(nbins=10,
steps=None,
integer=False,
symmetric=False,
prune=None,
min_n_ticks=2)
default_params = dict(nbins=10,
steps=None,
integer=False,
symmetric=False,
prune=None,
min_n_ticks=2)

def __init__(self, *args, **kwargs):
"""
Expand Down Expand Up @@ -1940,7 +1940,7 @@ def __init__(self, *args, **kwargs):
if len(args) > 1:
raise ValueError(
"Keywords are required for all arguments except 'nbins'")
self.set_params(**{**self._default_params, **kwargs})
self.set_params(**{**self.default_params, **kwargs})

@staticmethod
def _validate_steps(steps):
Expand All @@ -1957,16 +1957,6 @@ def _validate_steps(steps):
steps = np.hstack((steps, 10))
return steps

@cbook.deprecated("3.1")
@property
def default_params(self):
return self._default_params

@cbook.deprecated("3.1")
@default_params.setter
def default_params(self, params):
self._default_params = params

@staticmethod
def _staircase(steps):
# Make an extended staircase within which the needed
Expand Down
0