@@ -3835,11 +3835,18 @@ def scatter(self, x, y, s=20, c=None, marker='o', cmap=None, norm=None,
3835
3835
edgecolors = co
3836
3836
if facecolors is None :
3837
3837
facecolors = co
3838
+ if c is not None :
3839
+ raise ValueError ("Supply a 'c' kwarg or a 'color' kwarg"
3840
+ " but not both; they differ but"
3841
+ " their functionalities overlap." )
3838
3842
if c is None :
3839
3843
if facecolors is not None :
3840
3844
c = facecolors
3841
3845
else :
3842
3846
c = 'b' # The original default
3847
+ c_none = True
3848
+ else :
3849
+ c_none = False
3843
3850
3844
3851
self ._process_unit_info (xdata = x , ydata = y , kwargs = kwargs )
3845
3852
x = self .convert_xunits (x )
@@ -3858,16 +3865,19 @@ def scatter(self, x, y, s=20, c=None, marker='o', cmap=None, norm=None,
3858
3865
# c is an array for mapping. The potential ambiguity
3859
3866
# with a sequence of 3 or 4 numbers is resolved in
3860
3867
# favor of mapping, not rgb or rgba.
3861
- try :
3862
- c_array = np .asanyarray (c , dtype = float )
3863
- if c_array .size == x .size :
3864
- c = np .ma .ravel (c_array )
3865
- else :
3866
- # Wrong size; it must not be intended for mapping.
3867
- c_array = None
3868
- except ValueError :
3869
- # Failed to make a floating-point array; c must be color specs.
3868
+ if c_none or co is not None :
3870
3869
c_array = None
3870
+ else :
3871
+ try :
3872
+ c_array = np .asanyarray (c , dtype = float )
3873
+ if c_array .size == x .size :
3874
+ c = np .ma .ravel (c_array )
3875
+ else :
3876
+ # Wrong size; it must not be intended for mapping.
3877
+ c_array = None
3878
+ except ValueError :
3879
+ # Failed to make a floating-point array; c must be color specs.
3880
+ c_array = None
3871
3881
3872
3882
if c_array is None :
3873
3883
colors = c # must be acceptable as PathCollection facecolors
0 commit comments