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

Skip to content

DOC: MaxNLocator and contour/contourf doc update (replaces #16428) #16534

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
merged 1 commit into from
Mar 2, 2020
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
6 changes: 4 additions & 2 deletions lib/matplotlib/contour.py
Original file line number Diff line number Diff line change
Expand Up @@ -1612,8 +1612,10 @@ def _initialize_x_y(self, z):
levels : int or array-like, optional
Determines the number and positions of the contour lines / regions.

If an int *n*, use *n* data intervals; i.e. draw *n+1* contour
lines. The level heights are automatically chosen.
If an int *n*, use an algorithm
(see `~matplotlib.ticker.MaxNLocator`) that tries to provide
no more than *n+1* "nice" contour levels between vmin and vmax.
The level heights are automatically chosen.

If array-like, draw contour lines at the specified levels.
The values must be in increasing order.
Expand Down
3 changes: 2 additions & 1 deletion lib/matplotlib/ticker.py
Original file line number Diff line number Diff line change
Expand Up @@ -1991,7 +1991,8 @@ def ge(self, x):

class MaxNLocator(Locator):
"""
Select no more than N intervals at nice locations.
Find nice tick locations with no more than N being within the view limits.
Locations beyond the limits are added to support autoscaling.
"""
default_params = dict(nbins=10,
steps=None,
Expand Down