Matplotlib 为seaborn countplot中的所有条应用单色
以下代码为每个类别提供了不同的颜色Matplotlib 为seaborn countplot中的所有条应用单色,matplotlib,seaborn,Matplotlib,Seaborn,以下代码为每个类别提供了不同的颜色 import seaborn as sns sns.set(style="darkgrid") titanic = sns.load_dataset("titanic") ax = sns.countplot(x="class", data=titanic) 如何使它们具有相同的颜色? : seaborn.countplot(x=None,y=None,hue=None,data=None,order=None, 色调顺序=无,方向=无,颜色=无,调色板=无
import seaborn as sns
sns.set(style="darkgrid")
titanic = sns.load_dataset("titanic")
ax = sns.countplot(x="class", data=titanic)
如何使它们具有相同的颜色?
:
seaborn.countplot(x=None,y=None,hue=None,data=None,order=None,
色调顺序=无,方向=无,颜色=无,调色板=无,
饱和度=0.75,减淡=真,ax=无,**kwargs)
函数接受颜色参数,将其更改为更改颜色 像sns.countplot(x=“class”,data=titanic,color=“k”)@Sheldore谢谢,在中,你发布了plt.close(2)
,你能再次发布吗?我希望接受这一点(我看到你删除了答案,不知道谁投了反对票)。