| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
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.
Sorry, something went wrong.
|
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? |
Sorry, something went wrong.
|
@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. x2 = ax.secondary_xaxis(1.5) is not drawn. If we want it to do something else I'd be happy to change it. Good point on the examples, I'll take care of that. |
Sorry, something went wrong.
|
Hi @ZachDaChampion - it seems you also need a rebase here to incorporate changes made in the main branch. Here's a handy guide: https://matplotlib.org/stable/devel/development_workflow.html#rebasing-on-upstream-main Feel free to ping if you need more guidance! |
Sorry, something went wrong.
|
It appears that you did a merge instead of a rebase, which results in 884 commits (!!) showing up here. We have some docs for recovering from situations like this: https://matplotlib.org/stable/devel/development_workflow.html#recovering-from-mess-ups |
Sorry, something went wrong.
My bad, I didn't realize I pushed that version. Thanks for the link |
Sorry, something went wrong.
|
Now that we have typing stubs, it looks like you'll have to update the corresponding lines in the .pyi files. Also, please rebase to fix the CircleCI failures. |
Sorry, something went wrong.
|
Gentle ping to the reviewers - can you take another look here? Thanks! |
Sorry, something went wrong.
There was a problem hiding this comment.
Just a couple minor fixes.
Sorry, something went wrong.
|
I can rebase later if needed |
Sorry, something went wrong.
There was a problem hiding this comment.
Sorry we took a while to get back to this again. Just a couple minor fixes, but otherwise LGTM.
Sorry, something went wrong.
|
|
||
| fig, ax = plt.subplots(layout='constrained') | ||
| x = np.arange(0, 10) | ||
| np.random.seed(34) |
There was a problem hiding this comment.
We almost always use 19680801 as seed
| np.random.seed(34) | |
| np.random.seed(19680801) |
Sorry, something went wrong.
| else: | ||
| raise ValueError('secondary_yaxis location must be either ' | ||
| if not (location in ['left', 'right'] or isinstance(location, Real)): | ||
| raise ValueError('secondary_xaxis location must be either ' |
There was a problem hiding this comment.
Typo:
| raise ValueError('secondary_xaxis location must be either ' | |
| raise ValueError('secondary_yaxis location must be either ' |
Sorry, something went wrong.
| # Make sure transform is a Transform or None. | ||
| _api.check_isinstance((transforms.Transform, None), transform=transform) |
There was a problem hiding this comment.
I wouldn't bother with the comment; the function call is clear:
| # Make sure transform is a Transform or None. | |
| _api.check_isinstance((transforms.Transform, None), transform=transform) | |
| _api.check_isinstance((transforms.Transform, None), transform=transform) |
Sorry, something went wrong.
Add transform argument to secondary axes Update _secax_docstring Move new params to end of functions Add input check to secondary axes Add tests Add examples Move transform type checks and improve docs Add type stubs Update _secax_docstring Move new params to end of functions Add input check to secondary axes Move transform type checks and improve docs Fix rebase error Fix stub for SecondaryAxis.__init__ Clarify example Add default param to secax constructor Fix stub for secax constructor Simplify imports Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com> Remove redundancy in docs Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com> Fix typo
|
I've rebased, squashed into one commit, fixed the typos, and force pushed here in the interest of getting this merged. |
Sorry, something went wrong.
|
Thanks @ZachDaChampion and congratulations on your first contribution to Matplotlib. 🎉 We'd love to see you back! |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
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 to secondary_xaxis and secondary_yaxis and passed that through into SecondaryAxis._set_location(), where the transform is blended.
I also updated test_secondary_xy() and test_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
Release Notes