我试图将关键字参数传递给Seaborn catplot (或pointplot),但没有任何效果。下面的示例尝试将边缘颜色设置为黑色。这两种方法都会生成相同的图,没有任何边缘颜色。使用Seaborn 0.11.1
penguins = sns.load_dataset("penguins")
colormap = {"Adelie": "purple", "Chinstrap": "orange", "Gentoo": "green"}
### Try 1
sns.catplot(
kind="point",
data=penguins,
x="island",
y="bill_depth_mm",
hue="species",
palette=colormap,
scatter_kws = {"edgecolor":'black'}
)
### Try 2
sns.catplot(
kind="point",
data=penguins,
x="island",
y="bill_depth_mm",
hue="species",
palette=colormap,
edgecolor='black',
)

最终的目标是通过使用下面这样的东西来“破解”空心点:
sns.catplot(
kind="point",
data=penguins,
x="island",
y="bill_depth_mm",
hue="species",
palette=colormap,
ec=penguins["species"].map(colormap),
fc="none",
)发布于 2021-10-12 22:53:03
我认为edgecolor并不适用于所有类型的图
我试过使用散点图,它可以工作(如图中所示),但我认为使用pointplot或其他工具行不通。

https://stackoverflow.com/questions/69547741
复制相似问题