python颜色列表代码seaborn_如何在seaborn中切换两个类别的颜色?

SEABORN_PALETTES = dict(

deep=["#4C72B0", "#55A868", "#C44E52",

"#8172B2", "#CCB974", "#64B5CD"],

muted=["#4878CF", "#6ACC65", "#D65F5F",

"#B47CC7", "#C4AD66", "#77BEDB"],

pastel=["#92C6FF", "#97F0AA", "#FF9F9A",

"#D0BBFF", "#FFFEA3", "#B0E0E6"],

bright=["#003FFF", "#03ED3A", "#E8000B",

"#8A2BE2", "#FFC400", "#00D7FF"],

dark=["#001C7F", "#017517", "#8C0900",

"#7600A1", "#B8860B", "#006374"],

colorblind=["#0072B2", "#009E73", "#D55E00",

"#CC79A7", "#F0E442", "#56B4E9"]

)

sns.set(style="whitegrid", palette="muted")

iris = sns.load_dataset("iris")

iris = pd.melt(iris, "species", var_name="measurement")

muted = ["#4878CF", "#6ACC65", "#D65F5F", "#B47CC7", "#C4AD66", "#77BEDB"]

newPal = dict(setosa = muted[0], versicolor = muted[2], virginica = muted[1])

sns.swarmplot(x="measurement", y="value", hue="species", data=iris,palette=newPal )

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值