小编Jac*_*hen的帖子

如何更改绘图颜色饱和度

我已经安装了最新版本的seaborn(0.11.1)。当我使用自定义颜色绘制历史记录时,它显示的颜色与我预期的不同(请参阅 sns.palplot 的颜色)。对于某些 api,它有一个饱和参数,但对于 displot 则没有。

dat_plots_mod = dat_plots.copy(deep=True)
dat_plots_mod.loc[dat_plots_mod.LDS == "FC", "LDS"] = "F"
palette = ["#9b59b6", "#ff0000", "#00f0f0", "#00ff00", "#000000", "#320ff0"]
sns.set_theme(style="ticks", font_scale=1.3)
g = sns.displot(
    x="AgeRS", 
    hue="LDS", 
    data=dat_plots_mod, 
    palette=palette, 
    aspect=1.5,
)
g.set(ylabel="Number of samples", ylim=(0, 30))
Run Code Online (Sandbox Code Playgroud)

脚本和剧情结果截图

python colors seaborn displot

5
推荐指数
1
解决办法
7123
查看次数

标签 统计

colors ×1

displot ×1

python ×1

seaborn ×1