Skip to content

Clarify behavior of prune parameter to MaxNLocator. #27276

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
Nov 6, 2023
Merged
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
12 changes: 5 additions & 7 deletions lib/matplotlib/ticker.py
Original file line number Diff line number Diff line change
Expand Up @@ -1996,13 +1996,11 @@ def __init__(self, nbins=None, **kwargs):
If True, autoscaling will result in a range symmetric about zero.

prune : {'lower', 'upper', 'both', None}, default: None
Remove edge ticks -- useful for stacked or ganged plots where
the upper tick of one axes overlaps with the lower tick of the
axes above it, primarily when :rc:`axes.autolimit_mode` is
``'round_numbers'``. If ``prune=='lower'``, the smallest tick will
be removed. If ``prune == 'upper'``, the largest tick will be
removed. If ``prune == 'both'``, the largest and smallest ticks
will be removed. If *prune* is *None*, no ticks will be removed.
Remove the 'lower' tick, the 'upper' tick, or ticks on 'both' sides
*if they fall exactly on an axis' edge* (this typically occurs when
:rc:`axes.autolimit_mode` is 'round_numbers'). Removing such ticks
is mostly useful for stacked or ganged plots, where the upper tick
of an axes overlaps with the lower tick of the axes above it.

min_n_ticks : int, default: 2
Relax *nbins* and *integer* constraints if necessary to obtain
Expand Down