Title: [Bug]: ax.xaxis.set_label(...) doesn't set the x-axis label · Issue #27971 · matplotlib/matplotlib · GitHub
Open Graph Title: [Bug]: ax.xaxis.set_label(...) doesn't set the x-axis label · Issue #27971 · matplotlib/matplotlib
X Title: [Bug]: ax.xaxis.set_label(...) doesn't set the x-axis label · Issue #27971 · matplotlib/matplotlib
Description: Bug summary I'm used to using the Axis API like ax.xaxis.set_major_formatter(...) etc., so to be consistent it would be nice if one could do ax.xaxis.set_label(...) instead of ax.set_xlabel(...). It seems like ax.xaxis.set_label(...) doe...
Open Graph Description: Bug summary I'm used to using the Axis API like ax.xaxis.set_major_formatter(...) etc., so to be consistent it would be nice if one could do ax.xaxis.set_label(...) instead of ax.set_xlabel(...). I...
X Description: Bug summary I'm used to using the Axis API like ax.xaxis.set_major_formatter(...) etc., so to be consistent it would be nice if one could do ax.xaxis.set_label(...) instead of ax.set_xlabel(......
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/27971
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: ax.xaxis.set_label(...) doesn't set the x-axis label","articleBody":"### Bug summary\n\nI'm used to using the Axis API like `ax.xaxis.set_major_formatter(...)` etc., so to be consistent it would be nice if one could do `ax.xaxis.set_label(...)` instead of `ax.set_xlabel(...)`. It seems like `ax.xaxis.set_label(...)` does not label the axis however.\n\n### Code for reproduction\n\n```Python\nimport matplotlib.pyplot as plt\r\n\r\nfig, ax = plt.subplots()\r\nax.xaxis.set_label(\"x-label\")\n```\n\n\n### Actual outcome\n\n\u003cimg width=\"580\" alt=\"Screenshot 2024-03-24 at 10 02 10\" src=\"https://github.com/matplotlib/matplotlib/assets/6197628/1f11362e-c995-43b9-adeb-61b97009ce84\"\u003e\r\n\n\n### Expected outcome\n\n\u003cimg width=\"602\" alt=\"Screenshot 2024-03-24 at 10 02 26\" src=\"https://github.com/matplotlib/matplotlib/assets/6197628/8f7c4c49-c1b1-4790-b392-0538805b2dea\"\u003e\r\n\n\n### Additional information\n\n_No response_\n\n### Operating system\n\n_No response_\n\n### Matplotlib Version\n\n3.8.3\n\n### Matplotlib Backend\n\n_No response_\n\n### Python version\n\n_No response_\n\n### Jupyter version\n\n_No response_\n\n### Installation\n\nconda","author":{"url":"https://github.com/dstansby","@type":"Person","name":"dstansby"},"datePublished":"2024-03-24T10:02:51.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/27971/matplotlib/issues/27971"}
| 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:1f6b8cc8-6128-50d4-b18a-7655ddb0511b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A3EA:23903E:33FDF1:4882ED:6A53733B |
| html-safe-nonce | 12300dcc2bb207bb10e9a3cc06972cd58061f81774544a7e2908548fde6951d3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBM0VBOjIzOTAzRTozM0ZERjE6NDg4MkVEOjZBNTM3MzNCIiwidmlzaXRvcl9pZCI6Ijc0OTc5MjQzODgzODMzMjI5MzkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 3066fb64facd360752252c04a74101e986318870ca40a9bad79a05cb3e562bae |
| hovercard-subject-tag | issue:2204274852 |
| 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/27971/issue_layout |
| twitter:image | https://opengraph.githubassets.com/cdaea5ae4ad9fcfdc124f02bab97a578855c5608e37b2d92154280a868d672fd/matplotlib/matplotlib/issues/27971 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/cdaea5ae4ad9fcfdc124f02bab97a578855c5608e37b2d92154280a868d672fd/matplotlib/matplotlib/issues/27971 |
| og:image:alt | Bug summary I'm used to using the Axis API like ax.xaxis.set_major_formatter(...) etc., so to be consistent it would be nice if one could do ax.xaxis.set_label(...) instead of ax.set_xlabel(...). I... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dstansby |
| 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 | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width