Title: [Bug]: Figure.colorbar triggers colormesh deprecation · Issue #23614 · matplotlib/matplotlib · GitHub
Open Graph Title: [Bug]: Figure.colorbar triggers colormesh deprecation · Issue #23614 · matplotlib/matplotlib
X Title: [Bug]: Figure.colorbar triggers colormesh deprecation · Issue #23614 · matplotlib/matplotlib
Description: Bug summary xref #21723 In pandas, we have this matplotlib code calling Figure.colorbar which is triggering the colormesh deprecation: Auto-removal of grids by pcolor() and pcolormesh() is deprecated since 3.5 and will be removed two min...
Open Graph Description: Bug summary xref #21723 In pandas, we have this matplotlib code calling Figure.colorbar which is triggering the colormesh deprecation: Auto-removal of grids by pcolor() and pcolormesh() is deprecat...
X Description: Bug summary xref #21723 In pandas, we have this matplotlib code calling Figure.colorbar which is triggering the colormesh deprecation: Auto-removal of grids by pcolor() and pcolormesh() is deprecat...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/23614
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: Figure.colorbar triggers colormesh deprecation","articleBody":"### Bug summary\n\nxref https://github.com/matplotlib/matplotlib/issues/21723\r\n\r\nIn pandas, we have this matplotlib code calling `Figure.colorbar` which is triggering the colormesh deprecation:\r\n\r\n```\r\nAuto-removal of grids by pcolor() and pcolormesh() is deprecated since 3.5 and will be removed two minor releases later; please call grid(False) first.\r\n```\r\n\r\nhttps://github.com/pandas-dev/pandas/blob/03b4095f9de08af16db9698f15161b5a13a42286/pandas/plotting/_matplotlib/core.py#L1175-L1176\r\n\r\nAnd calling `ax.grid(False)` does not address the deprecation\r\n\r\n```\r\ndiff --git a/pandas/plotting/_matplotlib/core.py b/pandas/plotting/_matplotlib/core.py\r\nindex ee7493813f..69c749e84b 100644\r\n--- a/pandas/plotting/_matplotlib/core.py\r\n+++ b/pandas/plotting/_matplotlib/core.py\r\n@@ -1172,6 +1172,7 @@ class PlanePlot(MPLPlot, ABC):\r\n # GH33389, if ax is used multiple times, we should always\r\n # use the last one which contains the latest information\r\n # about the ax\r\n+ ax.grid(False)\r\n img = ax.collections[-1]\r\n return self.fig.colorbar(img, ax=ax, **kwds)\r\n```\n\n### Code for reproduction\n\n```python\nhttps://github.com/pandas-dev/pandas/blob/03b4095f9de08af16db9698f15161b5a13a42286/pandas/plotting/_matplotlib/core.py#L1175-L1176\n```\n\n\n### Actual outcome\n\n`Auto-removal of grids by pcolor() and pcolormesh() is deprecated since 3.5 and will be removed two minor releases later; please call grid(False) first.`\n\n### Expected outcome\n\nNo deprecation warning.\n\n### Additional information\n\n_No response_\n\n### Operating system\n\n_No response_\n\n### Matplotlib Version\n\n3.5.2\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\n_No response_","author":{"url":"https://github.com/mroeschke","@type":"Person","name":"mroeschke"},"datePublished":"2022-08-14T04:33:09.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/23614/matplotlib/issues/23614"}
| 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:e5684efb-e590-768c-1ade-e8d851129c69 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8DB8:333E4B:5804B8:763B16:6A53ECFE |
| html-safe-nonce | ac218312ebfd7132cf846374b4efe3c46f29369ed0f23d0f6327ecf1247e7cfd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4REI4OjMzM0U0Qjo1ODA0Qjg6NzYzQjE2OjZBNTNFQ0ZFIiwidmlzaXRvcl9pZCI6IjYxNDU4NjAzNjMxMjU5OTgwNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 0067da822f5d1c36b6904cd1fad3bbb8047c4b3f2a5b2c7e5557a017d53481b6 |
| hovercard-subject-tag | issue:1338131983 |
| 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/23614/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a496d1e7ead61b540553e4ef5b478e98dfe81d43757777eac25b45bc0ee221e3/matplotlib/matplotlib/issues/23614 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a496d1e7ead61b540553e4ef5b478e98dfe81d43757777eac25b45bc0ee221e3/matplotlib/matplotlib/issues/23614 |
| og:image:alt | Bug summary xref #21723 In pandas, we have this matplotlib code calling Figure.colorbar which is triggering the colormesh deprecation: Auto-removal of grids by pcolor() and pcolormesh() is deprecat... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mroeschke |
| 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