1
我正在嘗試使用自定義長度的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))
是什麼 「的步驟長度」 是什麼意思?顏色數量?每種顏色之間的感知距離? –