@@ -2209,7 +2209,7 @@ def add_collection3d(self, col, zs=0, zdir='z'):
2209
2209
2210
2210
Axes .add_collection (self , col )
2211
2211
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 ,
2213
2213
* args , ** kwargs ):
2214
2214
'''
2215
2215
Create a scatter plot.
@@ -2233,7 +2233,9 @@ def scatter(self, xs, ys, zs=0, zdir='z', s=20, c='b', depthshade=True,
2233
2233
that *c* should not be a single numeric RGB or RGBA
2234
2234
sequence because that is indistinguishable from an array
2235
2235
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.
2237
2239
2238
2240
*depthshade*
2239
2241
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,
2262
2264
2263
2265
s = np .ma .ravel (s ) # This doesn't have to match x, y in size.
2264
2266
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 )
2272
2276
2273
2277
patches = Axes .scatter (self , xs , ys , s = s , c = c , * args , ** kwargs )
2274
2278
if not cbook .iterable (zs ):
0 commit comments