Skip to content

Commit 72d2ff2

Browse files
committed
FIX: Handle RGB(A) values with pcolorfast
1 parent 5804110 commit 72d2ff2

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6394,14 +6394,10 @@ def pcolorfast(self, *args, alpha=None, norm=None, cmap=None, vmin=None,
63946394
if style == "quadmesh":
63956395
# data point in each cell is value at lower left corner
63966396
coords = np.stack([x, y], axis=-1)
6397-
if np.ndim(C) == 2:
6398-
qm_kwargs = {"array": np.ma.ravel(C)}
6399-
elif np.ndim(C) == 3:
6400-
qm_kwargs = {"color": np.ma.reshape(C, (-1, C.shape[-1]))}
6401-
else:
6397+
if np.ndim(C) not in {2, 3}:
64026398
raise ValueError("C must be 2D or 3D")
64036399
collection = mcoll.QuadMesh(
6404-
coords, **qm_kwargs,
6400+
coords, array=C,
64056401
alpha=alpha, cmap=cmap, norm=norm,
64066402
antialiased=False, edgecolors="none")
64076403
self.add_collection(collection, autolim=False)

0 commit comments

Comments
 (0)