Title: [Bug]: Setting alpha with an array is ignored with jupyterlab %inline backend · Issue #29595 · matplotlib/matplotlib · GitHub
Open Graph Title: [Bug]: Setting alpha with an array is ignored with jupyterlab %inline backend · Issue #29595 · matplotlib/matplotlib
X Title: [Bug]: Setting alpha with an array is ignored with jupyterlab %inline backend · Issue #29595 · matplotlib/matplotlib
Description: Bug summary If alpha is set as an array (of equal shape as the image data), the alpha value is ignored. This is failing for inline plots in Jupyter Lab. Code for reproduction import matplotlib print(matplotlib.__version__) import numpy a...
Open Graph Description: Bug summary If alpha is set as an array (of equal shape as the image data), the alpha value is ignored. This is failing for inline plots in Jupyter Lab. Code for reproduction import matplotlib prin...
X Description: Bug summary If alpha is set as an array (of equal shape as the image data), the alpha value is ignored. This is failing for inline plots in Jupyter Lab. Code for reproduction import matplotlib prin...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/29595
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: Setting alpha with an array is ignored with jupyterlab %inline backend","articleBody":"### Bug summary\n\nIf alpha is set as an array (of equal shape as the image data), the alpha value is ignored.\nThis is failing for inline plots in Jupyter Lab.\n\n### Code for reproduction\n\n```Python\nimport matplotlib\nprint(matplotlib.__version__)\n\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nimg_data = np.random.rand(256, 200)\nalpha = np.ones((256, 200))\nalpha[:, 0:100] = 0.5\nfig, ax = plt.subplots(1, 2, figsize=(10, 8))\nax[0].imshow(img_data, alpha=alpha)\nax[1].imshow(alpha)\n```\n\n### Actual outcome\n\n\u003cimg width=\"894\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/dde97c0a-f48b-436f-ad7d-174784bae280\" /\u003e\n\n### Expected outcome\n\n\u003cimg width=\"869\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/2afff9fe-b9bf-465f-9013-3deda8de3f1a\" /\u003e\n\n### Additional information\n\nWorked with Matplotlib 3.9.4 with numpy 2.2.1 \nFails in matplotlib 3.10.0 (same numpy), running in a Jupyter Lab cell. \nWorked as expected when run from the command line, with backend 'macosx', or if `%matplotlib osx` or `%matplotlib ipympl` is used to decorate the cell before running the code above. \n\n\n### Operating system\n\nOS/X\n\n### Matplotlib Version\n\n3.10.0\n\n### Matplotlib Backend\n\ninline\n\n### Python version\n\n3.13.1\n\n### Jupyter version\n\n4.3.4\n\n### Installation\n\nconda","author":{"url":"https://github.com/rhiannonlynne","@type":"Person","name":"rhiannonlynne"},"datePublished":"2025-02-09T02:21:38.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":7},"url":"https://github.com/29595/matplotlib/issues/29595"}
| 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:3cbd85bb-e0a3-9174-765e-2c6ed3356255 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9D7E:2B0738:196E9DC:22EF44F:6A536C12 |
| html-safe-nonce | d5536762f8daaedaf0bae368c7386eca08412c06af3071bd5b69ec6a18bd3906 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RDdFOjJCMDczODoxOTZFOURDOjIyRUY0NEY6NkE1MzZDMTIiLCJ2aXNpdG9yX2lkIjoiMzE5NDc1MjU4Mzg2MTQ5Njg1MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | d31ab45bac17ea6fa81e21b17970b1a04dff461af06ed863f726b2957d11e198 |
| hovercard-subject-tag | issue:2840386393 |
| 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/29595/issue_layout |
| twitter:image | https://opengraph.githubassets.com/cbc417a187b76748369ae7fb8c18f9e971f9fc962a3ff569f7616a30d8a0afca/matplotlib/matplotlib/issues/29595 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/cbc417a187b76748369ae7fb8c18f9e971f9fc962a3ff569f7616a30d8a0afca/matplotlib/matplotlib/issues/29595 |
| og:image:alt | Bug summary If alpha is set as an array (of equal shape as the image data), the alpha value is ignored. This is failing for inline plots in Jupyter Lab. Code for reproduction import matplotlib prin... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | rhiannonlynne |
| 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