Title: Behavior of masked values in colormap plot has changed in 2.2.0 · Issue #11039 · matplotlib/matplotlib · GitHub
Open Graph Title: Behavior of masked values in colormap plot has changed in 2.2.0 · Issue #11039 · matplotlib/matplotlib
X Title: Behavior of masked values in colormap plot has changed in 2.2.0 · Issue #11039 · matplotlib/matplotlib
Description: Bug report Bug summary Something changed the behavior of masked values in colormaps. Before, masked values on a 'jet' colormap would be drawn as white (and could be set to different colors with set_bad). This is no longer the case on mat...
Open Graph Description: Bug report Bug summary Something changed the behavior of masked values in colormaps. Before, masked values on a 'jet' colormap would be drawn as white (and could be set to different colors with set...
X Description: Bug report Bug summary Something changed the behavior of masked values in colormaps. Before, masked values on a 'jet' colormap would be drawn as white (and could be set to different colors ...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/11039
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Behavior of masked values in colormap plot has changed in 2.2.0","articleBody":"### Bug report\r\n\r\n**Bug summary**\r\n\r\nSomething changed the behavior of masked values in colormaps. Before, masked values on a 'jet' colormap would be drawn as white (and could be set to different colors with set_bad). This is no longer the case on matplotlib 2.2.0 - the masked values are being printed out as blue, the same color as valid values, and set_bad has no effect. Verified former behavior to be working on 2.1.1 and 2.0.2. \r\n\r\nNot sure this is an issue or expected behavior, but I couldn't find a description of this behavior change anywhere. Please close if this is expected.\r\n\r\nChanging interpolation from gaussian to none makes no difference (the sample code was originally used for another bug)\r\n\r\n**Code for reproduction**\r\n\r\n```python\r\nimport matplotlib.pyplot as plt\r\nimport matplotlib.colors\r\n\r\nheatmap = [[0] * 32 for _ in range(128)]\r\ncnt = 0\r\nlast = 1\r\nfor lvl in range(127):\r\n if lvl % 20 \u003c 10:\r\n for i in range(32):\r\n heatmap[lvl][i] = 40\r\n else:\r\n for i in range(32):\r\n heatmap[lvl][i] = 0\r\njet = plt.get_cmap('jet')\r\njet.set_bad('white', 1)\r\n\r\nplt.imshow(heatmap, origin='lower', interpolation='gaussian', aspect='auto', cmap=jet,\r\n norm=matplotlib.colors.LogNorm())\r\nplt.show()\r\n```\r\n\r\n**Actual outcome**\r\n\r\n\r\n\r\n**Expected outcome**\r\n\r\n\r\n\r\n**Matplotlib version**\r\n\u003c!--Please specify your platform and versions of the relevant libraries you are using:--\u003e\r\n * Operating system: Windows\r\n * Matplotlib version: 2.2.0\r\n * Matplotlib backend (`print(matplotlib.get_backend())`): TkAgg\r\n * Python version:3.6.3\r\n * Jupyter version (if applicable):\r\n * Other libraries: \r\n\r\nInstalled from pip\r\n","author":{"url":"https://github.com/arthur00","@type":"Person","name":"arthur00"},"datePublished":"2018-04-12T18:03:15.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":11},"url":"https://github.com/11039/matplotlib/issues/11039"}
| 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:4c8ee549-2263-b366-446f-1c75abad4e0e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9472:260009:1A80C94:2348614:6A52CB92 |
| html-safe-nonce | b3406a12475031947d6dedbe80aba6566cd1fdd0a9d8eb054f2cb3f38611e45f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NDcyOjI2MDAwOToxQTgwQzk0OjIzNDg2MTQ6NkE1MkNCOTIiLCJ2aXNpdG9yX2lkIjoiNTEyODQ4ODk5Mzg3MzM4MjI5MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | d7cbed4a1cd2e993d8745bbf89264a22d3da1f9d400ebb63ff7757d76b4cf0c4 |
| hovercard-subject-tag | issue:313830771 |
| 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/11039/issue_layout |
| twitter:image | https://opengraph.githubassets.com/62e2ae8f494cd9190711e3ca673bdcedaabccbc688472caffe5385c083c93f28/matplotlib/matplotlib/issues/11039 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/62e2ae8f494cd9190711e3ca673bdcedaabccbc688472caffe5385c083c93f28/matplotlib/matplotlib/issues/11039 |
| og:image:alt | Bug report Bug summary Something changed the behavior of masked values in colormaps. Before, masked values on a 'jet' colormap would be drawn as white (and could be set to different colors with set... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | arthur00 |
| 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