Skip to content

Commit e5a6cd6

Browse files
authored
Merge pull request #12531 from meeseeksmachine/auto-backport-of-pr-12431-on-v3.0.x
Backport PR #12431 on branch v3.0.x (FIX: allow single-string color for scatter)
2 parents 9b4cbcd + 1f2ca01 commit e5a6cd6

File tree

5 files changed

+209
-519
lines changed

5 files changed

+209
-519
lines changed

lib/matplotlib/axes/_axes.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import collections
12
import functools
23
import itertools
34
import logging
@@ -4187,7 +4188,11 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
41874188
valid_shape = True # will be put to the test!
41884189
n_elem = -1 # used only for (some) exceptions
41894190

4190-
if c_none or co is not None:
4191+
if (c_none or
4192+
co is not None or
4193+
isinstance(c, str) or
4194+
(isinstance(c, collections.Iterable) and
4195+
isinstance(c[0], str))):
41914196
c_array = None
41924197
else:
41934198
try: # First, does 'c' look suitable for value-mapping?
Binary file not shown.
Loading

0 commit comments

Comments
 (0)