Title: [ENH]: Default `matplotlib.colormaps[None]` to call `matplotlib.colormaps[matplotlib.rcParams['image.cmap']]`? · Issue #23981 · matplotlib/matplotlib · GitHub
Open Graph Title: [ENH]: Default `matplotlib.colormaps[None]` to call `matplotlib.colormaps[matplotlib.rcParams['image.cmap']]`? · Issue #23981 · matplotlib/matplotlib
X Title: [ENH]: Default `matplotlib.colormaps[None]` to call `matplotlib.colormaps[matplotlib.rcParams['image.cmap']]`? · Issue #23981 · matplotlib/matplotlib
Description: Problem While addressing the matplotlib.cm.get_cmap deprecation in 3.6: PendingDeprecationWarning: The get_cmap function will be deprecated in a future version. Use ``matplotlib.colormaps[name]`` instead. I noticed that None isn't direct...
Open Graph Description: Problem While addressing the matplotlib.cm.get_cmap deprecation in 3.6: PendingDeprecationWarning: The get_cmap function will be deprecated in a future version. Use ``matplotlib.colormaps[name]`` i...
X Description: Problem While addressing the matplotlib.cm.get_cmap deprecation in 3.6: PendingDeprecationWarning: The get_cmap function will be deprecated in a future version. Use ``matplotlib.colormaps[name]`` i...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/23981
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[ENH]: Default `matplotlib.colormaps[None]` to call `matplotlib.colormaps[matplotlib.rcParams['image.cmap']]`?","articleBody":"### Problem\n\nWhile addressing the `matplotlib.cm.get_cmap` deprecation in 3.6:\r\n\r\n```\r\nPendingDeprecationWarning: The get_cmap function will be deprecated in a future version. Use ``matplotlib.colormaps[name]`` instead.\r\n```\r\nI noticed that `None` isn't directly migrate-able \r\n\r\n```\r\nIn [1]: import matplotlib\r\n\r\nIn [2]: matplotlib.cm.get_cmap(None)\r\nOut[2]: \u003cmatplotlib.colors.ListedColormap at 0x11e609e20\u003e\r\n\r\nIn [3]: matplotlib.colormaps[None]\r\nKeyError: 'None is not a known colormap name'\r\n```\n\n### Proposed solution\n\nIt appears from the source that `get_cmap(None)` defaults to `matplotlib.rcParams['image.cmap']` so it would be nice if `colormaps[None]` could default to that as well.\r\n\r\nOtherwise, it would be nice if this was better documented.","author":{"url":"https://github.com/mroeschke","@type":"Person","name":"mroeschke"},"datePublished":"2022-09-21T21:00:40.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":6},"url":"https://github.com/23981/matplotlib/issues/23981"}
| 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:42015e18-dfaa-4a0b-72dd-d20883c5567c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B07A:FD134:2976891:3AF5878:6A510687 |
| html-safe-nonce | ca0e543e8cd134aaea1f156dfa795f73e8abc71cc54ce231057406a434febda5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMDdBOkZEMTM0OjI5NzY4OTE6M0FGNTg3ODo2QTUxMDY4NyIsInZpc2l0b3JfaWQiOiI0OTI0NzEwMTA3NTY0NjIyMTUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 72cca1b5a8dc59df2d7453158e2c83ce5a4719ea072d72a0361eea43c95f8838 |
| hovercard-subject-tag | issue:1381487093 |
| 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/23981/issue_layout |
| twitter:image | https://opengraph.githubassets.com/dd1579e8aa245ca34fbc2e35e08318f42092a187a6cd871b3c76e1f948bb9179/matplotlib/matplotlib/issues/23981 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/dd1579e8aa245ca34fbc2e35e08318f42092a187a6cd871b3c76e1f948bb9179/matplotlib/matplotlib/issues/23981 |
| og:image:alt | Problem While addressing the matplotlib.cm.get_cmap deprecation in 3.6: PendingDeprecationWarning: The get_cmap function will be deprecated in a future version. Use ``matplotlib.colormaps[name]`` i... |
| 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 | b076e100febaa00374cd89239f915d00dd3187f7c68b12bc2b7688181305344d |
| 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 | 2d129404fc45ea64edb1b98567c53e55b395536f |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width