2 Star 0 Fork 1

ljl / seaborn-doc-zh

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
50.md 1.18 KB
一键复制 编辑 原始数据 按行查看 历史
布客飞龙 提交于 2019-09-17 15:44 . 2019-09-17 15:44:00

seaborn.set_color_codes

译者:cancan233

seaborn.set_color_codes(palette='deep')

改变 matplotlib 颜色缩写词的解释方式。

调用此方法将改变 matplotlib 在后续图表中解释缩写词,例如"b"或"g"的方式。

参数: palette: {deep, muted, pastel, dark, bright, colorblind}

预命名的 seaborn 调色板,用作颜色的来源

参见

可以通过高级 seaborn 样式管理器设置颜色代码。也可以通过设置 matplotlib 颜色循环功能设置颜色代码。

示例:

将 matplotlib 颜色代码映射到默认的 seaborn 调色板。

>>> import matplotlib.pyplot as plt
>>> import seaborn as sns; sns.set()
>>> sns.set_color_codes()
>>> _ = plt.plot([0, 1], color="r")

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

使用不同的 seaborn 调色板

>>> sns.set_color_codes("dark")
>>> _ = plt.plot([0, 1], color="g")
>>> _ = plt.plot([0, 2], color="m")

http://seaborn.pydata.org/_images/seaborn-set_color_codes-2.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