Skip to content

Commit

Permalink
FIX: fix c raveling logic in scatter
Browse files Browse the repository at this point in the history
  • Loading branch information
tacaswell committed Sep 25, 2015
1 parent e94c609 commit 866b06f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/matplotlib/axes/_axes.py
Expand Up @@ -3827,6 +3827,7 @@ def scatter(self, x, y, s=20, c=None, marker='o', cmap=None, norm=None,
x = self.convert_xunits(x)
y = self.convert_yunits(y)

x_shape = x.shape
# np.ma.ravel yields an ndarray, not a masked array,
# unless its argument is a masked array.
x = np.ma.ravel(x)
Expand All @@ -3842,7 +3843,7 @@ def scatter(self, x, y, s=20, c=None, marker='o', cmap=None, norm=None,
# favor mapping, not rgb or rgba.
try:
c_array = np.asanyarray(c, dtype=float)
if c_array.shape == x.shape:
if c_array.shape == x_shape:
c = np.ma.ravel(c_array)
else:
# Wrong shape; it must not be intended for mapping.
Expand Down

0 comments on commit 866b06f

Please sign in to comment.