You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Doc]: Document how many out of bounds ticks Locators should return #25146
During discussion of #24436, and I think many other PRs and issues, we have (as a dev team) collectively been confused about what the behaviour of Locators should be when it comes to out of bounds ticks. We should decide and document the behaviour, partly for ourselves, and partly for third-parties using Locators (cf. #11518).
My opening suggestion is that we document:
Locators must return at least a single tick below vmin and a single tick above vmax
This is cautious in that it always provides a tick to clip when drawing at each end of the range.
I suspect that this is also related to the old (pre mpl2.0, but still available as rcparam) autolimits mode where the axis limits would be expanded to the "next" tick position; this was implemented (I guess) by relying on locators returning the first tick outside (or at) the limits as well and using them for autolimits.
Unless we want to deprecate that old autolimits mode (and which would break "classic" style) or grow an additional API on locators specifically to query these extra tick positions, we're probably stuck with that behavior.
This only marginally helps with the documentation, but perhaps knowing the motivation for the behavior is useful.
I tried to enforce at least one tick less than/greater than in #25225, and lots of tests failed. Notably histograms started having limits set to != 0 at the bottom, which isn't great. So to make our lives easier for now, I propose we instead say:
Locators must return at least a single tick at <= vmin and a single tick at >= vmax
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!
Activity
anntzer commentedon Feb 3, 2023
I suspect that this is also related to the old (pre mpl2.0, but still available as rcparam) autolimits mode where the axis limits would be expanded to the "next" tick position; this was implemented (I guess) by relying on locators returning the first tick outside (or at) the limits as well and using them for autolimits.
Unless we want to deprecate that old autolimits mode (and which would break "classic" style) or grow an additional API on locators specifically to query these extra tick positions, we're probably stuck with that behavior.
This only marginally helps with the documentation, but perhaps knowing the motivation for the behavior is useful.
Add a note that Locators must return ticks above and below vlims
dstansby commentedon Feb 15, 2023
I tried to enforce at least one tick less than/greater than in #25225, and lots of tests failed. Notably histograms started having limits set to != 0 at the bottom, which isn't great. So to make our lives easier for now, I propose we instead say:
github-actions commentedon Apr 20, 2026
This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!