Title: New function signatures in pyplot break Cartopy · Issue #12288 · matplotlib/matplotlib · GitHub
Open Graph Title: New function signatures in pyplot break Cartopy · Issue #12288 · matplotlib/matplotlib
X Title: New function signatures in pyplot break Cartopy · Issue #12288 · matplotlib/matplotlib
Description: This is just copied from #10918 (comment) to make it easier to follow. xref SciTools/cartopy#1126 Bug report @QuLogic: It turns out that passing named arguments for everything broke Cartopy a bit because the first parameter of imshow the...
Open Graph Description: This is just copied from #10918 (comment) to make it easier to follow. xref SciTools/cartopy#1126 Bug report @QuLogic: It turns out that passing named arguments for everything broke Cartopy a bit b...
X Description: This is just copied from #10918 (comment) to make it easier to follow. xref SciTools/cartopy#1126 Bug report @QuLogic: It turns out that passing named arguments for everything broke Cartopy a bit b...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/12288
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"New function signatures in pyplot break Cartopy","articleBody":"This is just copied from https://github.com/matplotlib/matplotlib/pull/10918#issuecomment-424239213 to make it easier to follow. xref SciTools/cartopy#1126\r\n\r\n### Bug report\r\n\r\n@QuLogic:\r\n\u003e It turns out that passing named arguments for everything broke Cartopy a bit because the first parameter of `imshow` there is `img`, not `X`.\r\n\u003e It's also started explicitly passing `data=None` to all wrapped `Axes` methods that accept labelled data, which is slightly problematic since `_preprocess_data` is not public.\r\n\r\n@anntzer:\r\n\u003e Sorry about that. It doesn't look too hard to make pyplot pass defaultless arguments positionally instead of as keywords if you'd like.\r\n\u003e I guess you prefer not passing data through when it's None? (There's a plan to make _preprocess_data public too but that's a side point.) Although they were already passing it before (at least in some cases, didn't check carefully) so I'm not sure what changed?\r\n\r\n@QuLogic\r\n\u003e We probably want to keep compatibility with old Cartopy, so we should change the positional arguments at least.\r\n\u003e \r\n\u003e As to data, it was never explicit before, but caught by `**kwargs`. If never passed, it would not appear at all in the final call. Now it's there explicitly (even if `None`). I'm not sure if it should or should not be explicit in the signature, but it would be best if it's not passed when `None` at the very least.\r\n\r\n**Code for reproduction**\r\n\r\n```python\r\nimport cartopy.crs as ccrs\r\nimport matplotlib.pyplot as plt\r\nimport numpy as np\r\n\r\n# First problem\r\nax = plt.axes(projection=crs.PlateCarree())\r\nplt.imshow(np.zeros((100, 100)))\r\n\r\n# Second problem\r\nplt.pcolormesh(np.zeros((100, 100)))\r\n```\r\n\r\n**Matplotlib version**\r\n * Operating system: Fedora 28\r\n * Matplotlib version: 3.0.0\r\n * Python version: 3.6.5\r\n * Other libraries: Cartopy 0.16","author":{"url":"https://github.com/QuLogic","@type":"Person","name":"QuLogic"},"datePublished":"2018-09-25T22:35:41.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/12288/matplotlib/issues/12288"}
| 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:bdb4b1da-ef39-b468-488c-d2eb1df50f35 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 83EC:262B56:A5AE:CD6D:6A52B64A |
| html-safe-nonce | 91062382318d9d7a9c9461de53468ede761f872a22b201799153020110612883 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4M0VDOjI2MkI1NjpBNUFFOkNENkQ6NkE1MkI2NEEiLCJ2aXNpdG9yX2lkIjoiNzg3MTg5ODI1MDM4Njc4MTc3MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 9ccb601a01d829846e9b10d51c6bd92a56ffe9f7fce82ffda9688d415640e6c1 |
| hovercard-subject-tag | issue:363791965 |
| 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/12288/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7c5d261c3e890770eeee345927a5ae86265c559c9764bafec52e07399a834b8d/matplotlib/matplotlib/issues/12288 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7c5d261c3e890770eeee345927a5ae86265c559c9764bafec52e07399a834b8d/matplotlib/matplotlib/issues/12288 |
| og:image:alt | This is just copied from #10918 (comment) to make it easier to follow. xref SciTools/cartopy#1126 Bug report @QuLogic: It turns out that passing named arguments for everything broke Cartopy a bit b... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | QuLogic |
| 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