@@ -4226,7 +4226,7 @@ def _parse_scatter_color_args(c, edgecolors, kwargs, xsize,
4226
4226
# favor of mapping, not rgb or rgba.
4227
4227
# Convenience vars to track shape mismatch *and* conversion failures.
4228
4228
valid_shape = True # will be put to the test!
4229
- n_elem = - 1 # used only for ( some) exceptions
4229
+ csize = - 1 # Number of colors; used for some exceptions.
4230
4230
4231
4231
if (c_was_none or
4232
4232
kwcolor is not None or
@@ -4238,8 +4238,8 @@ def _parse_scatter_color_args(c, edgecolors, kwargs, xsize,
4238
4238
else :
4239
4239
try : # First, does 'c' look suitable for value-mapping?
4240
4240
c_array = np .asanyarray (c , dtype = float )
4241
- n_elem = c_array .size
4242
- if n_elem == xsize :
4241
+ csize = c_array .size
4242
+ if csize == xsize :
4243
4243
c = c_array .ravel ()
4244
4244
else :
4245
4245
if c_array .shape in ((3 ,), (4 ,)):
@@ -4259,8 +4259,8 @@ def _parse_scatter_color_args(c, edgecolors, kwargs, xsize,
4259
4259
if c_array is None :
4260
4260
try : # Then is 'c' acceptable as PathCollection facecolors?
4261
4261
colors = mcolors .to_rgba_array (c )
4262
- n_elem = colors .shape [0 ]
4263
- if colors . shape [ 0 ] not in (0 , 1 , xsize ):
4262
+ csize = colors .shape [0 ]
4263
+ if csize not in (0 , 1 , xsize ):
4264
4264
# NB: remember that a single color is also acceptable.
4265
4265
# Besides *colors* will be an empty array if c == 'none'.
4266
4266
valid_shape = False
@@ -4270,7 +4270,7 @@ def _parse_scatter_color_args(c, edgecolors, kwargs, xsize,
4270
4270
raise ValueError (
4271
4271
"'c' argument has {nc} elements, which is not "
4272
4272
"acceptable for use with 'x' and 'y' with size {xs}."
4273
- .format (nc = n_elem , xs = xsize )
4273
+ .format (nc = csize , xs = xsize )
4274
4274
)
4275
4275
else :
4276
4276
# Both the mapping *and* the RGBA conversion failed: pretty
0 commit comments