Title: [Bug]: y_label in wrong place after clearing for twinx axes · Issue #28268 · matplotlib/matplotlib · GitHub
Open Graph Title: [Bug]: y_label in wrong place after clearing for twinx axes · Issue #28268 · matplotlib/matplotlib
X Title: [Bug]: y_label in wrong place after clearing for twinx axes · Issue #28268 · matplotlib/matplotlib
Description: Bug summary After making sexond axes on the righr with twinx y_label for this second axes is on the right, but clearing (doesn't matter is it cla() or clear()) second axes breaks set_ylabel putting it on the left. Ticks for second axes a...
Open Graph Description: Bug summary After making sexond axes on the righr with twinx y_label for this second axes is on the right, but clearing (doesn't matter is it cla() or clear()) second axes breaks set_ylabel putting...
X Description: Bug summary After making sexond axes on the righr with twinx y_label for this second axes is on the right, but clearing (doesn't matter is it cla() or clear()) second axes breaks set_ylabel put...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/28268
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: y_label in wrong place after clearing for twinx axes","articleBody":"### Bug summary\n\nAfter making sexond axes on the righr with twinx y_label for this second axes is on the right, but clearing _(doesn't matter is it cla() or clear())_ second axes breaks set_ylabel putting it on the left. Ticks for second axes are still on the right, so I don't see why y_label wouldn't also go there _(thats why I think its a bug)_\n\n### Code for reproduction\n\n```Python\nimport matplotlib\r\nimport matplotlib.pyplot as plt\r\n\r\nfigure = plt.figure()\r\nax = figure.add_subplot(111)\r\nax2 = ax.twinx()\r\nax2.cla()#or clear() ; doesn't work both ways\r\nax.set_ylabel('ax_label')\r\nax2.set_ylabel('ax2_label')#expected to be on the right\r\nplt.show()\n```\n\n\n### Actual outcome\n\n\r\n\n\n### Expected outcome\n\nafter clearing ax2 is still on the right, I expected its label also to be on the right\r\n\r\n\n\n### Additional information\n\nI saw that similar solved problems occurred with twinx()(it was something to do with mirroring), but I couldn't find solution for this specific situation\n\n### Operating system\n\n_No response_\n\n### Matplotlib Version\n\n3.7.1\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/katetsisar","@type":"Person","name":"katetsisar"},"datePublished":"2024-05-21T11:54:59.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":9},"url":"https://github.com/28268/matplotlib/issues/28268"}
| 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:43c534f0-0b91-e644-64ec-dd2d8afdda5e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B6DE:2D0224:1CE499A:2736D3F:6A524AEF |
| html-safe-nonce | 2efa48d16647fc7daea7014a933e1a1c1eb197fa537db67a79ea6e9a0fcfdbd4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNkRFOjJEMDIyNDoxQ0U0OTlBOjI3MzZEM0Y6NkE1MjRBRUYiLCJ2aXNpdG9yX2lkIjoiNDc4NDE2MjgzNTg0NzU5Njc4NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 675b45f306f0a3cdad75e99853fd681425772c6e59a46cf028cd0f51711769a0 |
| hovercard-subject-tag | issue:2308119715 |
| 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/28268/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f082f3ea8603d61241162b708ac8200b6fe1baf67365032a59008ab1d024cc8c/matplotlib/matplotlib/issues/28268 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f082f3ea8603d61241162b708ac8200b6fe1baf67365032a59008ab1d024cc8c/matplotlib/matplotlib/issues/28268 |
| og:image:alt | Bug summary After making sexond axes on the righr with twinx y_label for this second axes is on the right, but clearing (doesn't matter is it cla() or clear()) second axes breaks set_ylabel putting... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | katetsisar |
| 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