Skip to content

FIX: allow single-string color for scatter #12431

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import collections
import functools
import itertools
import logging
Expand Down Expand Up @@ -4184,7 +4185,11 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
valid_shape = True # will be put to the test!
n_elem = -1 # used only for (some) exceptions

if c_none or co is not None:
if (c_none or
co is not None or
isinstance(c, str) or
(isinstance(c, collections.Iterable) and
isinstance(c[0], str))):
c_array = None
else:
try: # First, does 'c' look suitable for value-mapping?
Expand Down
Binary file modified lib/matplotlib/tests/baseline_images/test_axes/scatter.pdf
Binary file not shown.
Binary file modified lib/matplotlib/tests/baseline_images/test_axes/scatter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading