@@ -3854,6 +3854,10 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
38543854 edgecolors = co
38553855 if facecolors is None :
38563856 facecolors = co
3857+ if c is not None :
3858+ raise ValueError ("Supply a 'c' kwarg or a 'color' kwarg"
3859+ " but not both; they differ but"
3860+ " their functionalities overlap." )
38573861 if c is None :
38583862 if facecolors is not None :
38593863 c = facecolors
@@ -3862,6 +3866,9 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
38623866 c = 'b' # The original default
38633867 else :
38643868 c = self ._get_patches_for_fill .get_next_color ()
3869+ c_none = True
3870+ else :
3871+ c_none = False
38653872
38663873 if edgecolors is None and not rcParams ['_internal.classic_mode' ]:
38673874 edgecolors = 'face'
@@ -3889,16 +3896,19 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
38893896 # c is an array for mapping. The potential ambiguity
38903897 # with a sequence of 3 or 4 numbers is resolved in
38913898 # favor of mapping, not rgb or rgba.
3892- try :
3893- c_array = np .asanyarray (c , dtype = float )
3894- if c_array .size == x .size :
3895- c = np .ma .ravel (c_array )
3896- else :
3897- # Wrong size; it must not be intended for mapping.
3898- c_array = None
3899- except ValueError :
3900- # Failed to make a floating-point array; c must be color specs.
3899+ if c_none or co is not None :
39013900 c_array = None
3901+ else :
3902+ try :
3903+ c_array = np .asanyarray (c , dtype = float )
3904+ if c_array .size == x .size :
3905+ c = np .ma .ravel (c_array )
3906+ else :
3907+ # Wrong size; it must not be intended for mapping.
3908+ c_array = None
3909+ except ValueError :
3910+ # Failed to make a floating-point array; c must be color specs.
3911+ c_array = None
39023912
39033913 if c_array is None :
39043914 colors = c # must be acceptable as PathCollection facecolors
0 commit comments