Closed
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 as np
import matplotlib.pyplot as plt
img_data = np.random.rand(256, 200)
alpha = np.ones((256, 200))
alpha[:, 0:100] = 0.5
fig, ax = plt.subplots(1, 2, figsize=(10, 8))
ax[0].imshow(img_data, alpha=alpha)
ax[1].imshow(alpha)
Actual outcome

Expected outcome

Additional information
Worked with Matplotlib 3.9.4 with numpy 2.2.1
Fails in matplotlib 3.10.0 (same numpy), running in a Jupyter Lab cell.
Worked 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.
Operating system
OS/X
Matplotlib Version
3.10.0
Matplotlib Backend
inline
Python version
3.13.1
Jupyter version
4.3.4
Installation
conda
Metadata
Metadata
Assignees
Labels
No labels