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
Allow passing a transformation to secondary_xaxis/_yaxis #25224
base: main
Are you sure you want to change the base?
Allow passing a transformation to secondary_xaxis/_yaxis #25224
Conversation
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.
Thank you for opening your first PR into Matplotlib!
If you have not heard from us in a while, please feel free to ping @matplotlib/developers
or anyone who has commented on the PR. Most of our reviewers are volunteers and sometimes things fall through the cracks.
You can also join us on gitter for real-time discussion.
For details on testing, writing docs, and our review process, please see the developer guide
We strive to be a welcoming and open project. Please follow our Code of Conduct.
This looks really useful, and a quick glance the code is great. Can we add an example, at least in the issue that shows the usefulness of this? Probably want one in the example gallery as well. I had to read your code to understand the context here, which if I understand is to allow the secondary xaxis to have a y position specified in data co-ordinates rather than just axes co-ordinates. If that is the case, what happens if the y data limits are set so the secondary axis is out of the Axes viewport? |
@jklymak Yes, you are correct on the context. Right now, if an axis is out of the viewport it isn't drawn. The existing function behaves the same if you give it a location outside of the viewport. E.g. Good point on the examples, I'll take care of that. |
PR Summary
resolves #25119.
I'm new to Matplotlib development so not sure if this is the best way to do this. I added a
transform
parameter tosecondary_xaxis
andsecondary_yaxis
and passed that through intoSecondaryAxis._set_location()
, where the transform is blended.I also updated
test_secondary_xy()
andtest_secondary_fail()
to test the transform.I'm not entirely sure if/where I'm meant to put
.. versionchanged::
in the docsting, but I'm happy to add it if it's needed.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