Edgecolor 未出现在 Seaborn 条带图上
Edgecolor not appearing on Seaborn stripplot
按照 Seaborn API 网站上的示例,我似乎无法让边缘颜色出现
这是我正在使用的
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")
但这就是正在策划的事情。我错过了什么吗?我正在使用 Seaborn .6 和 Matplotlib 1.4.3 Python 3
- 必须将大于 0 的
linewidth
添加到 seaborn.stripplot
,才能显示边缘颜色 (ec
)。
lw
不会报错,但如果linewidth
. 使用lw
,edgecolor不会显示
- 测试于
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)
按照 Seaborn API 网站上的示例,我似乎无法让边缘颜色出现
这是我正在使用的
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")
但这就是正在策划的事情。我错过了什么吗?我正在使用 Seaborn .6 和 Matplotlib 1.4.3 Python 3
- 必须将大于 0 的
linewidth
添加到seaborn.stripplot
,才能显示边缘颜色 (ec
)。lw
不会报错,但如果linewidth
. 使用
lw
,edgecolor不会显示 - 测试于
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)