-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
DOC: MaxNLocator and contour/contourf doc update #16428
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
DOC: MaxNLocator and contour/contourf doc update #16428
Conversation
Codecov Report
@@ Coverage Diff @@
## master #16428 +/- ##
==========================================
- Coverage 80.86% 80.46% -0.40%
==========================================
Files 307 307
Lines 75749 74407 -1342
Branches 9692 9688 -4
==========================================
- Hits 61252 59875 -1377
- Misses 11959 11987 +28
- Partials 2538 2545 +7
Continue to review full report at Codecov.
|
The issue seems to be our semi-standard confusion about who's job it is to clip out-of-range ticks: In [13]: import matplotlib.ticker as mticker
... locator = mticker.MaxNLocator(4+1, min_n_ticks=1)
... vmin, vmax = (-0.11109, 1-0.1111)
... t = locator.tick_values(vmin, vmax)
... print(t)
... print(f'total ticks {len(t)}')
... print(f'ticks in window {sum((vmin < t) * (t < vmax))}')
[-0.2 0. 0.2 0.4 0.6 0.8 1. ]
total ticks 7
ticks in window 5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make the proposed change.
Other than that I'd merge on the basis that this is an incremental doc improvement. I don't think it's worth digging deeper into tick clipping as part of this PR.
I messed my github matplotlib repo settings (and not github doesn't recognize my old branch... it says |
…_doc DOC: MaxNLocator and contour/contourf doc update (replaces #16428)
PR Summary
closes #12729
MaxNLocator
's docs were incorrect (please see the details described in #12729).Here is a numerical experiment that I ran to determine the difference between the number of tick locations returned by
MaxNLocator
and the argumentnbins
.It turns out (as was shown in the original issue) that
MaxNLocator
returns at mostnbins+2
tick locations (nbins+1
intervals).Since contour/contourf uses MaxNLocator (as pointed out in the original issue) updated their docs as well.
PR Checklist