Title: [ENH]: add_collection(..., autolim=True) should update view limits as well · Issue #29957 · matplotlib/matplotlib · GitHub
Open Graph Title: [ENH]: add_collection(..., autolim=True) should update view limits as well · Issue #29957 · matplotlib/matplotlib
X Title: [ENH]: add_collection(..., autolim=True) should update view limits as well · Issue #29957 · matplotlib/matplotlib
Description: 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_autosc...
Open Graph Description: 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 intern...
X Description: 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 intern...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/29957
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[ENH]: add_collection(..., autolim=True) should update view limits as well","articleBody":"### Problem\n\n`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`.\n\n### Proposed solution\n\n`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()`.\n\nTodo: Investigate how to make this work correctly for 3D, which seems to use a dedicated `auto_scale_xyz()`.","author":{"url":"https://github.com/timhoffm","@type":"Person","name":"timhoffm"},"datePublished":"2025-04-22T09:14:05.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/29957/matplotlib/issues/29957"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:172120da-7d9b-ff1c-b886-6576c5c960fa |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BAF6:33E60B:1C4AB48:26ACA3D:6A537371 |
| html-safe-nonce | 634f0c324577e29afff2198426ea405d21ba7f183c2c28e36e2ea52c07cc0de5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQUY2OjMzRTYwQjoxQzRBQjQ4OjI2QUNBM0Q6NkE1MzczNzEiLCJ2aXNpdG9yX2lkIjoiMjQ4NDI2MTM5ODQ5MTkxOTIxNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 0d8eb483ff7a00dd67e59528142ae9d32b8190277d652f9af04007805ea48a0a |
| hovercard-subject-tag | issue:3010466060 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/matplotlib/matplotlib/29957/issue_layout |
| twitter:image | https://opengraph.githubassets.com/94b859cc33e2064569a8d2815b3bf8abdba7f6a8d332f0315509a1110f5af89d/matplotlib/matplotlib/issues/29957 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/94b859cc33e2064569a8d2815b3bf8abdba7f6a8d332f0315509a1110f5af89d/matplotlib/matplotlib/issues/29957 |
| og:image:alt | 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 intern... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | timhoffm |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width