Title: [Bug]: alpha array-type not working with RGB image in imshow() · Issue #26092 · matplotlib/matplotlib · GitHub
Open Graph Title: [Bug]: alpha array-type not working with RGB image in imshow() · Issue #26092 · matplotlib/matplotlib
X Title: [Bug]: alpha array-type not working with RGB image in imshow() · Issue #26092 · matplotlib/matplotlib
Description: Bug summary Hi, Whereas alpha = constant works with RGB image, this is not the case when working with an array-type for alpha. (In my real case, I can only pass standard imshow parameters like alpha to the function of the library I use, ...
Open Graph Description: Bug summary Hi, Whereas alpha = constant works with RGB image, this is not the case when working with an array-type for alpha. (In my real case, I can only pass standard imshow parameters like alph...
X Description: Bug summary Hi, Whereas alpha = constant works with RGB image, this is not the case when working with an array-type for alpha. (In my real case, I can only pass standard imshow parameters like alph...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/26092
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: alpha array-type not working with RGB image in imshow()","articleBody":"### Bug summary\n\nHi,\r\nWhereas `alpha = constant` works with RGB image, this is not the case when working with an `array-type` for alpha.\r\n(In my real case, I can only pass standard imshow parameters like `alpha `to the function of the library I use, and not a RGBA array).\r\nPatrick\n\n### Code for reproduction\n\n```python\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nfrom skimage.color import gray2rgb\r\n\r\narr = np.random.random((10, 10))\r\narr_rgb = gray2rgb(arr)\r\n\r\nalpha = np.ones_like(arr)\r\nalpha[:5] = 0.2\r\n\r\nplt.figure()\r\nplt.tight_layout()\r\nplt.subplot(121)\r\nplt.title(\"Expected outcome\")\r\nplt.imshow(arr, alpha=alpha, cmap='gray')\r\nplt.subplot(122)\r\nplt.title(\"Actual outcome\")\r\nplt.imshow(arr_rgb, alpha=alpha)\r\nplt.show()\n```\n\n\n### Actual outcome\n\n\r\n\n\n### Expected outcome\n\n\r\n\n\n### Additional information\n\n_No response_\n\n### Operating system\n\nWindows\n\n### Matplotlib Version\n\n3.7.1\n\n### Matplotlib Backend\n\nTkAgg\n\n### Python version\n\nPython 3.10.11\n\n### Jupyter version\n\n_No response_\n\n### Installation\n\npip","author":{"url":"https://github.com/patquem","@type":"Person","name":"patquem"},"datePublished":"2023-06-08T09:26:24.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":35},"url":"https://github.com/26092/matplotlib/issues/26092"}
| 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:4aae150f-19b5-3183-3e46-b9677759af93 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 89FC:32BAC1:75D3E1:9E423E:6A52A6A8 |
| html-safe-nonce | cc61029eaf619b30db7e1f35e22256d90948469ee7169728b7a906e4eb3fece3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4OUZDOjMyQkFDMTo3NUQzRTE6OUU0MjNFOjZBNTJBNkE4IiwidmlzaXRvcl9pZCI6IjM2MzIzNTA3Njg1Mzc5NzAzNDQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | ecbc33cf9883019ba6c83a91e14320423abb6e00dbb347855754d7708a5b4297 |
| hovercard-subject-tag | issue:1747472486 |
| 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/26092/issue_layout |
| twitter:image | https://opengraph.githubassets.com/63f977bc131b52b1b86f8f32e644ccbc7b34fe96fd17ad30694b21b2a33e3748/matplotlib/matplotlib/issues/26092 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/63f977bc131b52b1b86f8f32e644ccbc7b34fe96fd17ad30694b21b2a33e3748/matplotlib/matplotlib/issues/26092 |
| og:image:alt | Bug summary Hi, Whereas alpha = constant works with RGB image, this is not the case when working with an array-type for alpha. (In my real case, I can only pass standard imshow parameters like alph... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | patquem |
| 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