Seaborn light_palette自定义长度
问题描述:
我正在尝试使用自定义长度的seaborn
进行顺序调色板。 seaborn
同时提供了light_palette
和dark_palette
,看起来与我想要的非常相似,但我需要自定义长度的步骤。我还需要匹配seaborn
的默认配色方案。Seaborn light_palette自定义长度
import seaborn as sns
sns.palplot(sns.light_palette(sns.color_palette()[0]))
我已经尝试了几种解决方案:
尝试1 - 使用seaborn.cubehelix_palette
,但我不能够匹配seaborn.color_palette()
import seaborn as sns
sns.palplot(sns.cubehelix_palette(7,start=1,rot=0,dark=0.22,light=0.8))
提供的颜色
尝试2 - 使用seaborn.diverging_palette
的一半,但我无法使颜色匹配。默认的颜色方案会输出RGB(76,114,176)或十六进制(#4C72B0)或HSL(217°40%49%)的蓝色,但输入这些参数时会出现错误的颜色。
import seaborn as sns
sns.palplot(sns.diverging_palette(217.,217.,n=7,s=40,l=49))
是什么 “的步骤长度” 是什么意思?颜色数量?每种颜色之间的感知距离? –