Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[ENH]: add_collection(..., autolim=True) should update view limits as well #29957

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

Open
timhoffm opened this issue Apr 22, 2025 · 2 comments · May be fixed by #29958
Open

[ENH]: add_collection(..., autolim=True) should update view limits as well #29957

timhoffm opened this issue Apr 22, 2025 · 2 comments · May be fixed by #29958

Comments

@timhoffm
Copy link
Member

timhoffm commented Apr 22, 2025

Problem

Axes.add_collection() has the parameter autolim, which updates Axes.dataLim, however it does not update Axes.viewLim. This requires an explicit ax.autoscale_view() - or when using it internally, we use the lazy ax._request_autoscale_view.

Proposed solution

Axes.add_collection(..., autolim=True) should itself call ax._request_autoscale_view(). If we opt into limits handling, this should possibly include the view limits as well. Requireing an extra call from users is cumbersome. Also since ax._request_autoscale_view() is private, users can only call the eager ax.autoscale_view().

Todo: Investigate how to make this work correctly for 3D, which seems to use a dedicated auto_scale_xyz().

@rcomer
Copy link
Member

rcomer commented Apr 22, 2025

Is this the same as #29219?

@timhoffm
Copy link
Member Author

Basically yes, though I haven't read through #29219 completely. I've started #29958 to give it a try. Let's see where that's still failing and needs extra work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants