Title: [ENH]: Be able to ignore specific plots when autoscaling axes · Issue #29634 · matplotlib/matplotlib · GitHub
Open Graph Title: [ENH]: Be able to ignore specific plots when autoscaling axes · Issue #29634 · matplotlib/matplotlib
X Title: [ENH]: Be able to ignore specific plots when autoscaling axes · Issue #29634 · matplotlib/matplotlib
Description: Problem When building up scatter or error bar plots of data, I frequently want to overlay a fitting function or other set of lines/bands. The latter need to extend for the full width/height of the Axes. If I'm using autoscaling, this doe...
Open Graph Description: Problem When building up scatter or error bar plots of data, I frequently want to overlay a fitting function or other set of lines/bands. The latter need to extend for the full width/height of the ...
X Description: Problem When building up scatter or error bar plots of data, I frequently want to overlay a fitting function or other set of lines/bands. The latter need to extend for the full width/height of the ...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/29634
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[ENH]: Be able to ignore specific plots when autoscaling axes","articleBody":"### Problem\n\nWhen building up scatter or error bar plots of data, I frequently want to overlay a fitting function or other set of lines/bands. The latter need to extend for the full width/height of the Axes. If I'm using autoscaling, this doesn't happen because the scale adjusts to leave a margin around the new plots.\n\nCurrently, to avoid this, I need to do something like:\n\n```\nxlim, ylim = ax.get_xlim(), ax.get_ylim()\nplt.plot(...) # Add lines\nax.set_xlim(xlim)\nax.set_ylim(ylim)\n```\n\nThis means I am constrained in how I order my code—I have to have all my data contributing to autoscaling present before I add any fit lines. (This gets more complicated when I am working with multiple Axes with `sharex` or `sharey`.)\n\nExample of what I might be looking for:\n\n\n\nExample of what I currently get without the workaround above:\n\n\n\n### Proposed solution\n\nIdeally, have a new keyword argument on `plot` and friends, something like `use_in_autoscale: bool = True`. When `True`, the object generated by `plot` contributes to the axis limit computations as currently; when `False`, then it is ignored in these computations.","author":{"url":"https://github.com/edbennett","@type":"Person","name":"edbennett"},"datePublished":"2025-02-17T10:31:59.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/29634/matplotlib/issues/29634"}
| 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:d8b7b1e2-e941-c3c1-c401-d69c775d8c8b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EB14:8E3D:289B0F:34D1BD:6A525A30 |
| html-safe-nonce | 037508d98355cb358a1dde1c0991581f62fe24a5501d64b29e342ce5c027a21c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQjE0OjhFM0Q6Mjg5QjBGOjM0RDFCRDo2QTUyNUEzMCIsInZpc2l0b3JfaWQiOiIzODQzOTY4MzQ2OTkyMzAyNjQwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | ac7ce79a711a18d0396d81f26885945f7ff678090bddc5f2b38397d5daf65ae9 |
| hovercard-subject-tag | issue:2857431233 |
| 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/29634/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2f4694354e485848ffa9a6b150e8b8268a6b7e9cbdffb42c093265eecfb0f2c2/matplotlib/matplotlib/issues/29634 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2f4694354e485848ffa9a6b150e8b8268a6b7e9cbdffb42c093265eecfb0f2c2/matplotlib/matplotlib/issues/29634 |
| og:image:alt | Problem When building up scatter or error bar plots of data, I frequently want to overlay a fitting function or other set of lines/bands. The latter need to extend for the full width/height of the ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | edbennett |
| 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 | 7aed05249554b889eb33d002851a973eebcc7e91 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width