Edgecolor not appearing on Seaborn stripplot

2.3k Views Asked by At

Following the example on the Seaborn API site and I can't seem to get the edgecolor to appear

Here's what I'm using

import seaborn as sns
sns.set_style("whitegrid")
tips = sns.load_dataset("tips")
ax = sns.boxplot(x="day", y="total_bill", data=tips)
ax = sns.stripplot(x="day", y="total_bill", data=tips, size=4, jitter=True, edgecolor="gray")

but this is the is what's being plotted. Am I missing something? I'm using Seaborn .6 and Matplotlib 1.4.3 with Python 3 MatplotlibPlot

Seaborn Boxplot API

1

There are 1 best solutions below

0
On BEST ANSWER
  • A linewidth greater than 0 must be added to seaborn.stripplot, for the edgecolor (ec) to show.
    • lw will not result in an error, but the edgecolor will not display if lw is used for linewidth.
  • Tested in python 3.8.11, pandas 1.3.3, matplotlib 3.4.3, seaborn 0.11.2
import seaborn as sns

# load dataframe
tips = sns.load_dataset("tips")

ax = sns.boxplot(x="day", y="total_bill", data=tips)

# add stripplot with linewidth=1
sns.stripplot(x="day", y="total_bill", data=tips, size=4, jitter=True,
              edgecolor="gray", ax=ax, linewidth=1)

enter image description here