-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
ENH: offset parameter for MultipleLocator #25542
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
Conversation
0d93384
to
8796a8c
Compare
I pushed a change without rebasing just to see what Mypy would do. It's running.... |
8796a8c
to
f386f33
Compare
@ksunden could you help me decipher this Mypy failure? |
@@ -53,7 +53,7 @@ def setup(ax, title): | |||
|
|||
# Index Locator | |||
setup(axs[4], title="IndexLocator(base=0.5, offset=0.25)") | |||
axs[4].plot(range(0, 5), [0]*5, color='white') | |||
axs[4].plot([0]*5, color='white') |
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.
It's not completely obvious from looking at this example what the difference is between MultipleLocator
and IndexLocator
. But from the API docs it seems to me that IndexLocator
makes most sense when the axis does not have numbers associated with it. So I took out the x-values.
I clearly should have done more homework before the Thursday call, then I would have known that offset is already used as a locator param 🤦♀️
a6782e7
to
8c720a9
Compare
8c720a9
to
ad37187
Compare
I think this is now ready for review. I have not [yet] added a what's new entry, as I'm still pretty unclear in general what the criteria are for deciding to do so. |
(I happened to read https://matplotlib.org/stable/devel/coding_guide.html#new-features-and-api-changes the other day...) Parameter makes sense! (Will review code when I have a bit more time.) |
Yes this should definitely get what's new entry |
1b82ad2
to
9ae5834
Compare
OK thanks. What's new now added. |
Co-authored-by: Ruth Comer 10599679+rcomer@users.noreply.github.com
9ae5834
to
1ad052e
Compare
PR Summary
Picked up from #21168. Adds an offset parameter to
MultipleLocator
so the ticks can all be shifted by a given value.### To Do1. Agree whether offset is the best name for the new parameter.2. Address documentation tasks in the below checklist, but I wanted to get feedback on the principle and the parameter name before I went all in.PR Checklist
Documentation and Tests
pytest
passes)Release Notes
.. versionadded::
directive in the docstring and documented indoc/users/next_whats_new/
.. versionchanged::
directive in the docstring and documented indoc/api/next_api_changes/
next_whats_new/README.rst
ornext_api_changes/README.rst