Skip to content

Commit e959692

Browse files
efiringanntzer
authored andcommitted
Fix bugs in scatter with invalid points and with integer arrays.
1 parent 85b1f96 commit e959692

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4347,7 +4347,7 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
43474347
edgecolors = 'face'
43484348
linewidths = rcParams['lines.linewidth']
43494349

4350-
offsets = np.column_stack([x, y])
4350+
offsets = np.ma.column_stack([x, y])
43514351

43524352
collection = mcoll.PathCollection(
43534353
(path,), scales,

lib/matplotlib/cbook/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,8 +1123,8 @@ def _combine_masks(*args):
11231123
if x.ndim > 1:
11241124
raise ValueError("Masked arrays must be 1-D")
11251125
x = np.asanyarray(x)
1126-
if x.ndim == 1 and x.dtype.kind == 'f':
1127-
x = np.ma.masked_invalid(x)
1126+
if x.ndim == 1:
1127+
x = safe_masked_invalid(x)
11281128
seqlist[i] = True
11291129
margs.append(x)
11301130
masks = [] # list of masks that are True where bad

0 commit comments

Comments
 (0)