@@ -4240,9 +4240,14 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
4240
4240
else :
4241
4241
colors = None # use cmap, norm after collection is created
4242
4242
4243
- if plotinvalid is False :
4244
- # `delete_masked_points` only modifies arguments of the same length
4245
- # as `x`.
4243
+ if plotinvalid and colors == None :
4244
+ # Do full color mapping; don't remove invalid c entries.
4245
+ ind = np .arange (len (c ))
4246
+ x , y , s , ind , colors , edgecolors , linewidths = \
4247
+ cbook .delete_masked_points (
4248
+ x , y , s , ind , colors , edgecolors , linewidths )
4249
+ c = np .ma .masked_invalid (c [ind ])
4250
+ else :
4246
4251
x , y , s , c , colors , edgecolors , linewidths = \
4247
4252
cbook .delete_masked_points (
4248
4253
x , y , s , c , colors , edgecolors , linewidths )
@@ -4289,12 +4294,7 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
4289
4294
if norm is not None and not isinstance (norm , mcolors .Normalize ):
4290
4295
raise ValueError (
4291
4296
"'norm' must be an instance of 'mcolors.Normalize'" )
4292
-
4293
- if plotinvalid is False :
4294
- collection .set_array (c )
4295
- else :
4296
- collection .set_array (ma .masked_invalid (c ))
4297
-
4297
+ collection .set_array (c )
4298
4298
collection .set_cmap (cmap )
4299
4299
collection .set_norm (norm )
4300
4300
0 commit comments