Title: [Bug]: Bad type hint in `_AxesBase.twinx()` · Issue #28624 · matplotlib/matplotlib · GitHub
Open Graph Title: [Bug]: Bad type hint in `_AxesBase.twinx()` · Issue #28624 · matplotlib/matplotlib
X Title: [Bug]: Bad type hint in `_AxesBase.twinx()` · Issue #28624 · matplotlib/matplotlib
Description: Bug summary Incorrect type annotation for _AxesBase.twinx() (should be Self, not _AxesBase). Code for reproduction import matplotlib.pyplot as plt import numpy as np # First create some toy data: x = np.linspace(0, 2 * np.pi, 400) y = np...
Open Graph Description: Bug summary Incorrect type annotation for _AxesBase.twinx() (should be Self, not _AxesBase). Code for reproduction import matplotlib.pyplot as plt import numpy as np # First create some toy data: x...
X Description: Bug summary Incorrect type annotation for _AxesBase.twinx() (should be Self, not _AxesBase). Code for reproduction import matplotlib.pyplot as plt import numpy as np # First create some toy data: x...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/28624
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: Bad type hint in `_AxesBase.twinx()`","articleBody":"### Bug summary\r\n\r\nIncorrect type annotation for `_AxesBase.twinx()` (should be `Self`, not `_AxesBase`).\r\n\r\n### Code for reproduction\r\n\r\n```Python\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\n\r\n# First create some toy data:\r\nx = np.linspace(0, 2 * np.pi, 400)\r\ny = np.sin(x**2)\r\nz = np.cos(x**2)\r\n\r\n# Create four polar Axes and access them through the returned array\r\nfig, axsA = plt.subplots()\r\naxsA.plot(x, y)\r\naxsB = axsA.twinx()\r\naxsB.plot(x, z) # \u003c-- Cannot access attribute \"plot\" for class \"_AxesBase\"\r\n```\r\n\r\n### Actual outcome\r\n\r\naxsB is of type `_AxesBase`\r\n\r\n### Expected outcome\r\n\r\nThe type of `axsB` should be the same as the type of `axsA`.\r\n\r\n### Matplotlib Version\r\n\r\n3.9.1","author":{"url":"https://github.com/randolf-scholz","@type":"Person","name":"randolf-scholz"},"datePublished":"2024-07-29T17:36:34.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/28624/matplotlib/issues/28624"}
| 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:6dc389a4-0e43-5a61-5d2e-1612d6407059 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AD34:1A5270:1FC048:2987F3:6A52EAA4 |
| html-safe-nonce | 4954252bc7d45effec0224625a890fb9ba107566c9582be5a2f80429260a8762 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRDM0OjFBNTI3MDoxRkMwNDg6Mjk4N0YzOjZBNTJFQUE0IiwidmlzaXRvcl9pZCI6IjQxNzEyOTMwMzE1OTU2OTg4NTIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | b58bab30a4033627f40a10eb254be107d7d796f73268f542efd60e4272e81f6e |
| hovercard-subject-tag | issue:2435979428 |
| 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/28624/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5bd5ca7b174c67620d50def6c50517b30c2e872b18aee4400b6b715277ae3cd9/matplotlib/matplotlib/issues/28624 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5bd5ca7b174c67620d50def6c50517b30c2e872b18aee4400b6b715277ae3cd9/matplotlib/matplotlib/issues/28624 |
| og:image:alt | Bug summary Incorrect type annotation for _AxesBase.twinx() (should be Self, not _AxesBase). Code for reproduction import matplotlib.pyplot as plt import numpy as np # First create some toy data: x... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | randolf-scholz |
| 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