diff --git a/seaborn/categorical.py b/seaborn/categorical.py index bb40d5d392..ee537975ca 100644 --- a/seaborn/categorical.py +++ b/seaborn/categorical.py @@ -2830,7 +2830,11 @@ def catplot( if saturation < 1: color = desaturate(color, saturation) - edgecolor = p._complement_color(kwargs.pop("edgecolor", default), color, p._hue_map) + if kind in ["strip", "swarm"]: + kwargs = _normalize_kwargs(kwargs, mpl.collections.PathCollection) + kwargs["edgecolor"] = p._complement_color( + kwargs.pop("edgecolor", default), color, p._hue_map + ) width = kwargs.pop("width", 0.8) dodge = kwargs.pop("dodge", False if kind in undodged_kinds else "auto") @@ -2841,7 +2845,6 @@ def catplot( jitter = kwargs.pop("jitter", True) plot_kws = kwargs.copy() - plot_kws["edgecolor"] = edgecolor plot_kws.setdefault("zorder", 3) plot_kws.setdefault("linewidth", 0) if "s" not in plot_kws: @@ -2858,7 +2861,6 @@ def catplot( warn_thresh = kwargs.pop("warn_thresh", .05) plot_kws = kwargs.copy() - plot_kws["edgecolor"] = edgecolor plot_kws.setdefault("zorder", 3) if "s" not in plot_kws: plot_kws["s"] = plot_kws.pop("size", 5) ** 2 diff --git a/tests/test_categorical.py b/tests/test_categorical.py index 7031d0940c..99816c2063 100644 --- a/tests/test_categorical.py +++ b/tests/test_categorical.py @@ -2307,7 +2307,7 @@ def test_err_kws(self, fill): dict(data="long", x="a", y="y", errorbar=("pi", 50)), dict(data="long", x="a", y="y", errorbar=None), dict(data="long", x="a", y="y", capsize=.3, err_kws=dict(c="k")), - dict(data="long", x="a", y="y", color="blue", ec="green", alpha=.5), + dict(data="long", x="a", y="y", color="blue", edgecolor="green", alpha=.5), ] ) def test_vs_catplot(self, long_df, wide_df, null_df, flat_series, kwargs):