Title: Issue · GitHub
Open Graph Title: Issue · matplotlib/matplotlib
X Title: Issue · matplotlib/matplotlib
Description: matplotlib: plotting with Python. Contribute to matplotlib/matplotlib development by creating an account on GitHub.
Open Graph Description: matplotlib: plotting with Python. Contribute to matplotlib/matplotlib development by creating an account on GitHub.
X Description: matplotlib: plotting with Python. Contribute to matplotlib/matplotlib development by creating an account on GitHub.
Opengraph URL: https://github.com/matplotlib/matplotlib
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[MNT]: Define Axes.clear semantics","articleBody":"### Summary\n\n`Axes.clear()` / `Axes.cla()` are only documented as \"Clear the Axes\". What exactly \"clear\" means is neither documented nor well defined. We reset some stuff and keep other.\n\nThis leads to a number of issues:\n- Axes.cla() resets axis label position of twin axes #28846 and associated PR #28101\n- y_label in wrong place after clearing for twinx axes #28268 (and duplicate #28846)\n- Axes.cla() with sharex may wrongly reset the axes limit. #27825\n- Axes.clear does not reset axislabel or ticklabel sizes #21239\n\nThere has been some inital work in #23839, but the topic is not completely solved.\n\n### Proposed fix\n\nWe need to define what `clear` means.\n\nFirst on an abstract level: This could be a starting point:\n\n- All data-like content should be removed (actual data, labels, etc.)\n- Scales and limits should be reset\n- Layout should stay (axes position, twinning)\n- Formatting: t.b.d.\n\nWhen the high-level definition is agreed upon, we need to define what that means for concrete cases.\ne.g. it's clear that we remove label content. Should label positions also be reset (e.g. if somebody has moved the xlabel to top)? - This may also depend on the anticipated use case: One wants to reuse the Axes for a new plot. How similar is it to the old plot. Does it only get new data and labels or could it be a completely different plot?","author":{"url":"https://github.com/timhoffm","@type":"Person","name":"timhoffm"},"datePublished":"2024-09-20T08:29:51.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/28851/matplotlib/issues/28851"}
| route-pattern | /:user_id/:repository/issues/:id(.:format) |
| route-controller | issues |
| route-action | show |
| fetch-nonce | v2:55c81cd4-c4c4-6ce1-733f-3fe77a431a87 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B916:B0958:2713087:33BEE06:6A520D3A |
| html-safe-nonce | c98e49ef026e25efda7b682ee77fe0f372a491621530365d6488b89a28490dd7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCOTE2OkIwOTU4OjI3MTMwODc6MzNCRUUwNjo2QTUyMEQzQSIsInZpc2l0b3JfaWQiOiIxNTg4MTM5NjkwNzc0NjI5NjkwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 393bf5b26665b7fb22221b05395069a674e5a45e19c1cfecc20ebc1f07f0abc5 |
| hovercard-subject-tag | repository:1385122 |
| 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/matplotlib/matplotlib/issues/28851 |
| twitter:image | https://opengraph.githubassets.com/9261bf81ff8848b426c0823e67448cf51d35b63d999294ff18880398e6b5b195/matplotlib/matplotlib |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9261bf81ff8848b426c0823e67448cf51d35b63d999294ff18880398e6b5b195/matplotlib/matplotlib |
| og:image:alt | matplotlib: plotting with Python. Contribute to matplotlib/matplotlib development by creating an account on GitHub. |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-cache |
| 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