Title: Unexpected change in behavior in plt.subplot · Issue #19432 · matplotlib/matplotlib · GitHub
Open Graph Title: Unexpected change in behavior in plt.subplot · Issue #19432 · matplotlib/matplotlib
X Title: Unexpected change in behavior in plt.subplot · Issue #19432 · matplotlib/matplotlib
Description: Bug report Bug summary #19153 introduced some changes that had (I think) unintended consequences when passing custom kwargs to projections Code for reproduction Prior to #19153, the following code returned False, that is, two different a...
Open Graph Description: Bug report Bug summary #19153 introduced some changes that had (I think) unintended consequences when passing custom kwargs to projections Code for reproduction Prior to #19153, the following code ...
X Description: Bug report Bug summary #19153 introduced some changes that had (I think) unintended consequences when passing custom kwargs to projections Code for reproduction Prior to #19153, the following code ...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/19432
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Unexpected change in behavior in plt.subplot","articleBody":"\u003c!--To help us understand and resolve your issue, please fill out the form to the best of your ability.--\u003e\r\n\u003c!--You can feel free to delete the sections that do not apply.--\u003e\r\n\r\n### Bug report\r\n\r\n**Bug summary**\r\n\r\n#19153 introduced some changes that had (I think) unintended consequences when passing custom kwargs to projections\r\n\r\n**Code for reproduction**\r\n\r\nPrior to #19153, the following code returned ``False``, that is, two different axes were created:\r\n\r\n```python\r\nfrom astropy.wcs import WCS\r\nimport matplotlib.pyplot as plt\r\n\r\nwcs1 = WCS(naxis=3)\r\nwcs1.wcs.ctype = ['x', 'y', 'z']\r\n\r\nax1 = plt.subplot(1, 1, 1, projection=wcs1, slices=('x', 'y', 1))\r\n\r\nwcs2 = WCS(naxis=3)\r\nwcs2.wcs.ctype = ['a', 'b', 'c']\r\n\r\nax2 = plt.subplot(1, 1, 1, projection=wcs2, slices=('x', 2, 'y'))\r\n\r\nprint(ax1 is ax2)\r\n```\r\n\r\nNo deprecation warning or future warning was raised in this case.\r\n\r\nFollowing #19153, this silently ignores the projection and slices in the second call and the print statement returns ``True``.\r\n\r\nI don't think #19153 was intended to start making ``plt.subplot`` return the same axes in some cases, rather I thought the goal of that PR was to remove re-use of axes in certain circumstances, so I think this is a regression/bug\r\n\r\n**Actual outcome**\r\n\r\n``ax1`` and ``ax2`` are the same\r\n\r\n**Expected outcome**\r\n\r\n``ax1`` and ``ax2`` should be different","author":{"url":"https://github.com/astrofrog","@type":"Person","name":"astrofrog"},"datePublished":"2021-02-02T13:06:13.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":27},"url":"https://github.com/19432/matplotlib/issues/19432"}
| 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:65bbdd7a-162a-72df-4763-68fd9217849d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DF78:1357D4:EB85DC:13DD86F:6A517483 |
| html-safe-nonce | 293d0be226f534378dead571778e7a5e42067b0e6861c2181474d6431395db12 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERjc4OjEzNTdENDpFQjg1REM6MTNERDg2Rjo2QTUxNzQ4MyIsInZpc2l0b3JfaWQiOiIzOTgzMTIwMjA2NDM2MzMyNjc1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 783d505fd1ed4c3ea71a8fafde444b5621214f2724b5e9dc5b9973fb9307455f |
| hovercard-subject-tag | issue:799264210 |
| 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/19432/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c3f9e1aa15ef95583e262ae8dcc8d1be350ba5b99803fe0593e29f6d2a12b82d/matplotlib/matplotlib/issues/19432 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c3f9e1aa15ef95583e262ae8dcc8d1be350ba5b99803fe0593e29f6d2a12b82d/matplotlib/matplotlib/issues/19432 |
| og:image:alt | Bug report Bug summary #19153 introduced some changes that had (I think) unintended consequences when passing custom kwargs to projections Code for reproduction Prior to #19153, the following code ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | astrofrog |
| 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 | b19955a9dd40fd99462443f7911b522d7216776a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width