Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 49e7156

Browse filesBrowse files
committed
Scatter color ValueError now reports size; More efficient color validation
1 parent 65e6a64 commit 49e7156
Copy full SHA for 49e7156

File tree

Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-4
lines changed

‎lib/matplotlib/axes/_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/axes/_axes.py
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3985,14 +3985,14 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
39853985
c_array = None
39863986

39873987
if c_array is None:
3988-
colors = c # must be acceptable as PathCollection facecolors
39893988
try:
3990-
mcolors.to_rgba_array(colors)
3989+
# must be acceptable as PathCollection facecolors
3990+
colors = mcolors.to_rgba_array(c)
39913991
except ValueError:
39923992
# c not acceptable as PathCollection facecolor
39933993
msg = ("c of shape {0} not acceptable as a color sequence "
3994-
"for x with shape {1}, y with shape {2}")
3995-
raise ValueError(msg.format(c.shape, x.shape, y.shape))
3994+
"for x with size {1}, y with size {2}")
3995+
raise ValueError(msg.format(c.shape, x.size, y.size))
39963996
else:
39973997
colors = None # use cmap, norm after collection is created
39983998

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.