我正在尝试使用自定义长度的seaborn
制作一个顺序调色板。seaborn
同时提供了light_palette
和{seaborn
的默认配色方案。在
import seaborn as sns
sns.palplot(sns.light_palette(sns.color_palette()[0]))
我尝试了几种解决方案:
尝试1-使用seaborn.cubehelix_palette
,但是我无法匹配seaborn.color_palette()
提供的颜色
尝试2-使用seaborn.diverging_palette
的一半,但我也无法使颜色匹配。默认的配色方案会显示一种蓝色,即RGB(76114176)或hex(#4C72B0)或HSL(217°40%49%),但当输入这些参数时,我得到了错误的颜色。在
import seaborn as sns
sns.palplot(sns.diverging_palette(217.,217.,n=7,s=40,l=49))
通过在对调色板的调用中指定这个数字,可以获得具有
N
颜色的调色板。在相关问题 更多 >
编程相关推荐