8000 Backport PR #12686: Remove deprecation warnings in tests · timhoffm/matplotlib@ede33e5 · GitHub
[go: up one dir, main page]

Skip to content

Commit ede33e5

Browse files
committed
Backport PR matplotlib#12686: Remove deprecation warnings in tests
1 parent 2e1fdf1 commit ede33e5

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
import six
55
from six.moves import xrange, zip, zip_longest
66

7+
try:
8+
import collections.abc as collections_abc
9+
except ImportError:
10+
import collections as collections_abc
711
import functools
812
import itertools
913
import logging
@@ -4268,7 +4272,11 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
42684272
# c is an array for mapping. The potential ambiguity
42694273
# with a sequence of 3 or 4 numbers is resolved in
42704274
# favor of mapping, not rgb or rgba.
4271-
if c_none or co is not None:
4275+
if (c_none or
4276+
co is not None or
4277+
isinstance(c, six.string_types) or
4278+
(isinstance(c, collections_abc.Iterable) and
4279+
isinstance(c[0], six.string_types))):
42724280
c_array = None
42734281
else:
42744282
try:

0 commit comments

Comments
 (0)
0