Skip to content

Commit 13627d3

Browse files
committed
fix error in scatter
1 parent 1412ce0 commit 13627d3

File tree

1 file changed

+2
-15
lines changed

1 file changed

+2
-15
lines changed

lib/matplotlib/axes/_axes.py

+2-15
Original file line numberDiff line numberDiff line change
@@ -3979,17 +3979,6 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
39793979
else:
39803980
try:
39813981
c_array = np.asanyarray(c, dtype=float)
3982-
if c_array.ndim > 1:
3983-
if cmap is None:
3984-
cmap = mcolors.BivariateColormap()
3985-
if norm is None:
3986-
norm = mcolors.BivariateNorm()
3987-
c_array = norm(c_array)
3988-
c_array[0] = c_array[0] * (cmap.N-1)
3989-
c_array[1] = c_array[1] * (cmap.N-1)
3990-
c_array = c_array.astype(int)
3991-
c_array = c_array[0] + cmap.N * c_array[1]
3992-
norm = mcolors.NoNorm()
39933982
if c_array.shape in xy_shape:
39943983
c = np.ma.ravel(c_array)
39953984
else:
@@ -4054,10 +4043,8 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
40544043
collection.update(kwargs)
40554044

40564045
if colors is None:
4057-
isNorm = isinstance(norm, (mcolors.Normalize, mcolors.BivariateNorm))
4058-
if norm is not None and not isNorm:
4059-
msg = "'norm' must be an instance of 'mcolors.Normalize' " \
4060-
"or 'mcolors.BivariateNorm'"
4046+
if norm is not None and not isinstance(norm, mcolors.Normalize):
4047+
msg = "'norm' must be an instance of 'mcolors.Normalize'"
40614048
raise ValueError(msg)
40624049
collection.set_array(np.asarray(c))
40634050
collection.set_cmap(cmap)

0 commit comments

Comments
 (0)