Skip to content

Commit 1755c7b

Browse files
committed
Ignore rows of RGB[A] tuples when making scatter colormap
1 parent 02a5ce3 commit 1755c7b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

proplot/wrappers.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1171,9 +1171,14 @@ def scatter_wrapper(
11711171
cmap = constructor.Colormap(cmap, **cmap_kw)
11721172

11731173
# Get normalizer and levels
1174+
# NOTE: If the length of the c array !=
11741175
ticks = None
11751176
carray = np.atleast_1d(c)
1176-
if np.issubdtype(carray.dtype, np.number) and len(carray) > 3:
1177+
if (
1178+
np.issubdtype(carray.dtype, np.number)
1179+
and not (carray.ndim == 2 and carray.shape[1] in (3, 4))
1180+
):
1181+
carray = carray.ravel()
11771182
norm, cmap, _, ticks = _build_discrete_norm(
11781183
carray, # sample data for getting suitable levels
11791184
N=N, levels=levels, values=values,

0 commit comments

Comments
 (0)