@@ -2209,7 +2209,7 @@ def add_collection3d(self, col, zs=0, zdir='z'):
22092209
22102210 Axes .add_collection (self , col )
22112211
2212- def scatter (self , xs , ys , zs = 0 , zdir = 'z' , s = 20 , c = 'b' , depthshade = True ,
2212+ def scatter (self , xs , ys , zs = 0 , zdir = 'z' , s = 20 , c = None , depthshade = True ,
22132213 * args , ** kwargs ):
22142214 '''
22152215 Create a scatter plot.
@@ -2233,7 +2233,9 @@ def scatter(self, xs, ys, zs=0, zdir='z', s=20, c='b', depthshade=True,
22332233 that *c* should not be a single numeric RGB or RGBA
22342234 sequence because that is indistinguishable from an array
22352235 of values to be colormapped. *c* can be a 2-D array in
2236- which the rows are RGB or RGBA, however.
2236+ which the rows are RGB or RGBA, however, including the
2237+ case of a single row to specify the same color for
2238+ all points.
22372239
22382240 *depthshade*
22392241 Whether or not to shade the scatter markers to give
@@ -2262,13 +2264,15 @@ def scatter(self, xs, ys, zs=0, zdir='z', s=20, c='b', depthshade=True,
22622264
22632265 s = np .ma .ravel (s ) # This doesn't have to match x, y in size.
22642266
2265- cstr = cbook .is_string_like (c ) or cbook .is_sequence_of_strings (c )
2266- if not cstr :
2267- c = np .asanyarray (c )
2268- if c .size == xs .size :
2269- c = np .ma .ravel (c )
2270-
2271- xs , ys , zs , s , c = cbook .delete_masked_points (xs , ys , zs , s , c )
2267+ if c is not None :
2268+ cstr = cbook .is_string_like (c ) or cbook .is_sequence_of_strings (c )
2269+ if not cstr :
2270+ c = np .asanyarray (c )
2271+ if c .size == xs .size :
2272+ c = np .ma .ravel (c )
2273+ xs , ys , zs , s , c = cbook .delete_masked_points (xs , ys , zs , s , c )
2274+ else :
2275+ xs , ys , zs , s = cbook .delete_masked_points (xs , ys , zs , s )
22722276
22732277 patches = Axes .scatter (self , xs , ys , s = s , c = c , * args , ** kwargs )
22742278 if not cbook .iterable (zs ):
0 commit comments