Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Description
Bug summary
Hi,
Whereasalpha = constant
works with RGB image, this is not the case when working with anarray-type
for alpha.
(In my real case, I can only pass standard imshow parameters likealpha
to the function of the library I use, and not a RGBA array).
Patrick
Code for reproduction
importnumpyasnpimportmatplotlib.pyplotaspltfromskimage.colorimportgray2rgbarr=np.random.random((10,10))arr_rgb=gray2rgb(arr)alpha=np.ones_like(arr)alpha[:5]=0.2plt.figure()plt.tight_layout()plt.subplot(121)plt.title("Expected outcome")plt.imshow(arr,alpha=alpha,cmap='gray')plt.subplot(122)plt.title("Actual outcome")plt.imshow(arr_rgb,alpha=alpha)plt.show()
Actual outcome
Expected outcome
Additional information
No response
Operating system
Windows
Matplotlib Version
3.7.1
Matplotlib Backend
TkAgg
Python version
Python 3.10.11
Jupyter version
No response
Installation
pip