8000 Raise warning if both c and facecolors are used in scatter plot. In t… · matplotlib/matplotlib@5a26bb9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5a26bb9

Browse files
committed
Raise warning if both c and facecolors are used in scatter plot. In the future we may implement c as edgecolors in that case or cause plot to fail.
1 parent 1c4a554 commit 5a26bb9

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4613,10 +4613,20 @@ def _parse_scatter_color_args(c, edgecolors, kwargs, xsize,
46134613
edgecolors = kwcolor
46144614
if facecolors is None:
46154615
facecolors = kwcolor
4616-
4616+
4617+
46174618
if edgecolors is None and not mpl.rcParams['_internal.classic_mode']:
46184619
edgecolors = mpl.rcParams['scatter.edgecolors']
46194620

4621+
# Raise a warning if both `c` and `facecolor` are set (issue #24404).
4622+
if c is not None and facecolors is not None:
4623+
_api.warn_external(
4624+
"You passed both c and facecolor/facecolors for the markers. "
4625+
"Matplotlib is ignoring the facecolor "
4626+
"in favor of what you specified in c. "
4627+
"This behavior may change in the future."
4628+
)
4629+
46204630
c_was_none = c is None
46214631
if c is None:
46224632
c = (facecolors if facecolors is not None

0 commit comments

Comments
 (0)
0