Skip to content
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

Add ability to add a patch without updating data limits #19685

Open
dstansby opened this issue Mar 11, 2021 · 5 comments
Open

Add ability to add a patch without updating data limits #19685

dstansby opened this issue Mar 11, 2021 · 5 comments
Labels
keep Items to be ignored by the “Stale” Github Action New feature

Comments

@dstansby
Copy link
Member

Problem

In sunpy we have come across a case where we want to imshow and image, and then overplot a circle on top of that image. The circle is bigger than the image, and we want to keep the axes limits to those of the image, so ideally we would like a way to add a patch, without the patch updating the data limits. As far as I can tell this isn't possible currently.

To work around this we are using add_artist() instead of add_patch(), but as I understand from #19290 this might change in the future.

Proposed Solution

ax.plot() can take scalex, scaley keywords, that indicate whether the x/y limits are updated, so maybe a similar API for add_patch(), or individual Patch objects would be helpful.

Additional context and prior art

@jklymak
Copy link
Member

jklymak commented Mar 11, 2021

I think @anntzer had a suggested an artist property autolim that can be toggled if an artist is going to be in the limit algorithm or not? Parallel to set_layout https://matplotlib.org/stable/api/_as_gen/matplotlib.artist.Artist.set_in_layout.html

@anntzer
Copy link
Contributor

anntzer commented Mar 11, 2021

#15595 is what I was championing, but it kind of stalled.
FWIW the first snippet at #19296 is what I'm using personally right now (wrapped in a contextmanager).

@jklymak
Copy link
Member

jklymak commented Mar 11, 2021

#15595 seemed to be broadly supported, so it should be able to move forward if someone is excited about it...

@timhoffm
Copy link
Member

timhoffm commented Mar 11, 2021

Do we agree on the proposed API? #15595 (comment)

Nobody has answered back on that.

Copy link

This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!

@github-actions github-actions bot added the status: inactive Marked by the “Stale” Github Action label Nov 27, 2023
@anntzer anntzer added keep Items to be ignored by the “Stale” Github Action and removed status: inactive Marked by the “Stale” Github Action labels Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
keep Items to be ignored by the “Stale” Github Action New feature
Projects
None yet
Development

No branches or pull requests

4 participants