Title: [Bug]: Cannot change xlabel after drawing custom axes with xlabel · Issue #31288 · matplotlib/matplotlib · GitHub
Open Graph Title: [Bug]: Cannot change xlabel after drawing custom axes with xlabel · Issue #31288 · matplotlib/matplotlib
X Title: [Bug]: Cannot change xlabel after drawing custom axes with xlabel · Issue #31288 · matplotlib/matplotlib
Description: Bug summary This bug occurs when I set xlabel of axisartist.Axes to some non-empty string, and draw the figure, but when I set the xlabel to another string, the figure does not change. Code for reproduction import matplotlib.pyplot as pl...
Open Graph Description: Bug summary This bug occurs when I set xlabel of axisartist.Axes to some non-empty string, and draw the figure, but when I set the xlabel to another string, the figure does not change. Code for rep...
X Description: Bug summary This bug occurs when I set xlabel of axisartist.Axes to some non-empty string, and draw the figure, but when I set the xlabel to another string, the figure does not change. Code for rep...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/31288
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: Cannot change xlabel after drawing custom axes with xlabel","articleBody":"### Bug summary\n\nThis bug occurs when I set xlabel of `axisartist.Axes` to some non-empty string, and draw the figure, but when I set the xlabel to another string, the figure does not change.\n\n### Code for reproduction\n\n```Python\nimport matplotlib.pyplot as plt\nimport mpl_toolkits.axisartist as axisartist\n\nfig = plt.figure()\nax = fig.add_subplot(axes_class=axisartist.Axes)\nax.axis[\"top\"].set_visible(False)\nax.axis[\"right\"].set_visible(False)\n\nax.set_xlabel(\"first label\")\nfig.draw_without_rendering()\nax.set_xlabel(\"second label\")\nplt.show()\n```\n\n### Actual outcome\n\n\u003cimg width=\"553\" height=\"432\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/315bd328-55f2-41c9-b0fc-0e222350c9d1\" /\u003e\n\n### Expected outcome\n\n\u003cimg width=\"553\" height=\"432\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/aaf8ebbd-d968-4b97-838f-c950aa03ce1b\" /\u003e\n\n### Additional information\n\n_No response_\n\n### Operating system\n\n_No response_\n\n### Matplotlib Version\n\n0.2.0.dev53848+unknown.gd5f597d3d\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\nNone","author":{"url":"https://github.com/williamlus","@type":"Person","name":"williamlus"},"datePublished":"2026-03-12T07:50:38.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/31288/matplotlib/issues/31288"}
| 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:4e3ec4d1-1fbf-2057-000d-0874ade5807f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8718:3AC7E6:29984D3:37789B8:6A521748 |
| html-safe-nonce | d68bb64f165d586e9d5060e99f93d14efd9d11bbf89126ec9cb5aee27b87e648 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NzE4OjNBQzdFNjoyOTk4NEQzOjM3Nzg5Qjg6NkE1MjE3NDgiLCJ2aXNpdG9yX2lkIjoiODE2MjcwNjI3NjkzMDk1MDk4NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b9e7e3d278712e44acd1eaf82e613f1d27651a95148b6b3ad8bfc5ec61200c1d |
| hovercard-subject-tag | issue:4062872367 |
| 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/31288/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5649288d9eee1234db75b00fd36a9d9492c926bc0b99f18ba9dfa450d59ac031/matplotlib/matplotlib/issues/31288 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5649288d9eee1234db75b00fd36a9d9492c926bc0b99f18ba9dfa450d59ac031/matplotlib/matplotlib/issues/31288 |
| og:image:alt | Bug summary This bug occurs when I set xlabel of axisartist.Axes to some non-empty string, and draw the figure, but when I set the xlabel to another string, the figure does not change. Code for rep... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | williamlus |
| 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