Skip to content

Commit

Permalink
Fix edgecolor in catplot with kind='bar'
Browse files Browse the repository at this point in the history
Fixes #3542
  • Loading branch information
mwaskom committed Nov 4, 2023
1 parent 3351a17 commit 4b7f341
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion seaborn/categorical.py
Original file line number Diff line number Diff line change
Expand Up @@ -2830,7 +2830,10 @@ 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"]:
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")
Expand Down
2 changes: 1 addition & 1 deletion tests/test_categorical.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 4b7f341

Please sign in to comment.