ENH: offset parameter for MultipleLocator#25542
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? |
| # 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.
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 [email protected]
9ae5834 to
1ad052e
Compare
PR Summary
Picked up from #21168. Adds an offset parameter to
MultipleLocatorso 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
pytestpasses)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.rstornext_api_changes/README.rst