2 Star 0 Fork 1

ljl / seaborn-doc-zh

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
56.md 1.47 KB
一键复制 编辑 原始数据 按行查看 历史
Joseph.L.Meng 提交于 2019-04-07 02:12 . Update 56.md

seaborn.hls_palette

译者:Modrisco

seaborn.hls_palette(n_colors=6, h=0.01, l=0.6, s=0.65)

在 HLS 色调空间中获取一组均匀间隔的颜色。

h, s, 和 l 值应该在 0 和 1 之间。

参数:n_colors:int

调色板中的颜色数

h:float

第一个色调

l:float

亮度

s:float

饱和度

返回值:palette:seaborn 调色板

类似列表的颜色对象的 RGB 元组。

另外

在 HUSL 系统中使用等间距圆形色调创建一个调色板。

例子

使用默认参数创建一个有 10 种颜色的调色板:

>>> import seaborn as sns; sns.set()
>>> sns.palplot(sns.hls_palette(10))

http://seaborn.pydata.org/_images/seaborn-hls_palette-1.png

创建一个以不同色调值开头的 10 种颜色的调色板:

>>> sns.palplot(sns.hls_palette(10, h=.5))

http://seaborn.pydata.org/_images/seaborn-hls_palette-2.png

创建一个比默认颜色更暗的 10 种颜色的调色板:

>>> sns.palplot(sns.hls_palette(10, l=.4))

http://seaborn.pydata.org/_images/seaborn-hls_palette-3.png

创建 10 种颜色的调色板,其饱和度低于默认值:

>>> sns.palplot(sns.hls_palette(10, s=.4))

http://seaborn.pydata.org/_images/seaborn-hls_palette-4.png

马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/jinliang186/seaborn-doc-zh.git
git@gitee.com:jinliang186/seaborn-doc-zh.git
jinliang186
seaborn-doc-zh
seaborn-doc-zh
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891