Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1f2ca01

Browse files
tacaswellMeeseeksDev[bot]
authored and
MeeseeksDev[bot]
committed
Backport PR #12431: FIX: allow single-string color for scatter
1 parent 9b4cbcd commit 1f2ca01

File tree

5 files changed

+209
-519
lines changed

5 files changed

+209
-519
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 6 additions & 1 deletion
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)