Title: [Bug]: `matplotlib.cm.get_cmap()` missing · Issue #28349 · matplotlib/matplotlib · GitHub
Open Graph Title: [Bug]: `matplotlib.cm.get_cmap()` missing · Issue #28349 · matplotlib/matplotlib
X Title: [Bug]: `matplotlib.cm.get_cmap()` missing · Issue #28349 · matplotlib/matplotlib
Description: Bug summary As of matplotlib v3.9, it appears that matplotlib.cm.get_cmap() is missing. It is still available on matplotlib.pyplot.get_cmap(), though. matplotlib.cm.get_cmap() is still shown in the documentation and I would be surprised ...
Open Graph Description: Bug summary As of matplotlib v3.9, it appears that matplotlib.cm.get_cmap() is missing. It is still available on matplotlib.pyplot.get_cmap(), though. matplotlib.cm.get_cmap() is still shown in the...
X Description: Bug summary As of matplotlib v3.9, it appears that matplotlib.cm.get_cmap() is missing. It is still available on matplotlib.pyplot.get_cmap(), though. matplotlib.cm.get_cmap() is still shown in the...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/28349
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: `matplotlib.cm.get_cmap()` missing","articleBody":"### Bug summary\r\n\r\nAs of matplotlib v3.9, it appears that `matplotlib.cm.get_cmap()` is missing. It is still available on `matplotlib.pyplot.get_cmap()`, though.\r\n\r\n`matplotlib.cm.get_cmap()` [is still shown in the documentation](https://matplotlib.org/devdocs/api/cm_api.html#matplotlib.cm.ColormapRegistry.get_cmap) and I would be surprised if this change was made without some kind of deprecation warning.\r\n\r\n### Code for reproduction\r\n\r\n```Python\r\nIn [1]: from matplotlib import pyplot, cm\r\n\r\nIn [2]: pyplot.get_cmap('gray')\r\nOut[2]: \u003cmatplotlib.colors.LinearSegmentedColormap at 0x7f6b2c7303d0\u003e\r\n\r\nIn [3]: cm.get_cmap('gray')\r\n---------------------------------------------------------------------------\r\nAttributeError Traceback (most recent call last)\r\nCell In[3], line 1\r\n----\u003e 1 cm.get_cmap('gray')\r\n\r\nAttributeError: module 'matplotlib.cm' has no attribute 'get_cmap'\r\n```\r\n\r\n\r\n### Actual outcome\r\n\r\n---------------------------------------------------------------------------\r\nAttributeError Traceback (most recent call last)\r\nCell In[3], line 1\r\n----\u003e 1 cm.get_cmap('gray')\r\n\r\nAttributeError: module 'matplotlib.cm' has no attribute 'get_cmap'\r\n\r\n### Expected outcome\r\n\r\nShould return the `gray` colormap.\r\n\r\n### Additional information\r\n\r\nThis works in matplotlib \u003c3.9 and is still shown in the documentation. It is kind of odd that this function is available from two locations, though.\r\n\r\n\r\n### Operating system\r\n\r\nAny\r\n\r\n### Matplotlib Version\r\n\r\n3.9.0\r\n\r\n### Matplotlib Backend\r\n\r\nagg\r\n\r\n### Python version\r\n\r\n3.11.9\r\n\r\n### Jupyter version\r\n\r\n_No response_\r\n\r\n### Installation\r\n\r\npip","author":{"url":"https://github.com/jsolbrig","@type":"Person","name":"jsolbrig"},"datePublished":"2024-06-05T16:31:09.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/28349/matplotlib/issues/28349"}
| 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:b9fa501c-97fb-e8dd-ab40-47eadbec2f65 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A7E0:33F819:7D74E1:A85E51:6A530794 |
| html-safe-nonce | 4c54868eda3eb38f6d134fd3afe00d2b6e4958f53a7a8d876be996b4c14e0349 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBN0UwOjMzRjgxOTo3RDc0RTE6QTg1RTUxOjZBNTMwNzk0IiwidmlzaXRvcl9pZCI6IjM5MTE0MTA2MjUwMDg1NjgyMTIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | eefbbe646960449ef67c20ba2eed57c80debca1c625c5367c82963254bfbec02 |
| hovercard-subject-tag | issue:2336356386 |
| 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/28349/issue_layout |
| twitter:image | https://opengraph.githubassets.com/945799ab743e38593d505b64a8a55304adb8c53337d0acf1ec088e02c7ad34c5/matplotlib/matplotlib/issues/28349 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/945799ab743e38593d505b64a8a55304adb8c53337d0acf1ec088e02c7ad34c5/matplotlib/matplotlib/issues/28349 |
| og:image:alt | Bug summary As of matplotlib v3.9, it appears that matplotlib.cm.get_cmap() is missing. It is still available on matplotlib.pyplot.get_cmap(), though. matplotlib.cm.get_cmap() is still shown in the... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jsolbrig |
| 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