Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Add Inset Zoom Axes with Automatic Plotting of Parent Axes Artists.#22060
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Add Inset Zoom Axes with Automatic Plotting of Parent Axes Artists.#22060
Uh oh!
There was an error while loading.Please reload this page.
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 uson gitter for real-time discussion.
For details on testing, writing docs, and our review process, please seethe developer guide
We strive to be a welcoming and open project. Please follow ourCode of Conduct.
This looks really cool, and I'm sure a number of folks would like this. However, this would be a significant new maintenance burden, so there is a bit of a cost-benefit analysis to be done. Do we want a whole shadow canvas just for this feature? Are there other uses for this concept? I'm also concerned about consistency. You increase the size of image pixels (OK), you increase the size of text (maybe OK), but you donot increase the thickness of lines. What happens to markers? Do they zoom or stay the same? It seems that if you want a zoom, then you want everything to zoom? |
I've not looked into the details here: Could this start off as a third-party package. That's a good way to make code public if we are not yet sure whether we can maintain it in the main library. |
I hadn't considered starting this off as a third-party package, though I think thats a great idea, I'll start working on getting one together as soon as I have some free time to do so. Is there any preference in how the third party package should integrate itself into matplotlib (API wise)? |
I think the approach here looks quite cool, but I also agree that this can reasonably start as a third-party package. |
We talked about this on the call today, this is super cool! The proposed path forward here is :
I would suggest anytime you want to write an ax.foo(...)foo(ax, ...) The biggest advantage of letting this start as a stand-alone project is that you will be able to do releases more-or-less at will rather than being tied to our ~6mo intended (7-8mo actual) release cycle, push to the repo at will, and have the ability to aggressively make breaking changes to the API. A concern about doing this as a stand-alone project is you are touching a number of private methods on the renderer, however those have been stable for a very long time and if the end-goal is to get this in the main repo, we think that is a reasonable risk. |
I'm happy to hear that you're still interested in incorporating this into matplotlib. I think the concept of starting it as a third party package makes a lot of sense, as after making this PR I've realized there are some additional features that might be desired (such as adding elements to the axes which is a view of another, which currently doesn't work) and the API can be made much cleaner than the one in this PR. I've gone ahead and gone through with the first step above as suggested, and set up a repo and PyPI package for this project. I've also reworked the code so it can be easily applied to any Axes. Github Repo:https://github.com/isaacrobinson2000/matplotview PyPI Package:https://pypi.org/project/matplotview/ Since this is now a third party package, I'm assuming this PR is not really necessary nor helpful at this point, meaning it can probably be closed. Again, thanks for all of the helpful feedback! |
Sounds good@isaacrobinson2000 ! Can you please add it tohttps://github.com/matplotlib/mpl-third-party as well (and make sure you add the |
Thanks! I've made the above edits. Looking at the second step above, should I just go ahead and transfer the matplotview repo to the matplotlib organization, or is there something that should be done before I do that? |
@isaacrobinson2000 Add me as a collaborator with I think admin rights on your repo and I'll do the move. |
Thanks, let me know if you can do the move, there doesn't seem to be any options for collaborator permissions in the settings. |
Hmm, they have changed their ACL from the last time I looked at doing this. Can you try transferring it to me? |
Sure, consider it done! |
This now lives athttps://github.com/matplotlib/matplotview |
Uh oh!
There was an error while loading.Please reload this page.
PR Summary
Extends the inset axes API adding a new method
Axes.inset_zoom_axes
. Has the same signature and behavior asinset_axes
, except it returns a subclass ofAxes
capable of automatically rendering the contents of the parent axes. This means plot elements don't need to be plotted again on the inset axes to be visible.Supports all artists types (some of them shown in the above example), and any new ones that may eventually be added. It achieves this using a custom
Renderer
which transforms the data before deferring it the the actual underlyingRenderer
which does the actual drawing. It should work on all backends, I've personally tested the svg, png, pdf, and qt backends. I initially implemented this for a personal project and thought it might be nice to have directly in matplotlib.PR Checklist
Tests and Styling
pytest
passes).flake8-docstrings
and runflake8 --docstring-convention=all
).Documentation
doc/users/next_whats_new/
(follow instructions in README.rst there).doc/api/next_api_changes/
(follow instructions in README.rst there).