seaborn.
set_color_codes
(palette='deep')¶更改matplotlib颜色缩写的解释方式。
调用此函数将改变matplotlib在后续绘图中解释“b”或“g”等速记代码的方式。
命名为seaborn调色板,用作颜色来源。
参见
set
颜色代码可以通过高级seaborn样式管理器设置。
set_palette
也可以通过设置matplotlib颜色循环的函数设置颜色代码。
实例
将matplotlib颜色代码映射到默认的seaborn调色板。
>>> import matplotlib.pyplot as plt
>>> import seaborn as sns; sns.set_theme()
>>> sns.set_color_codes()
>>> _ = plt.plot([0, 1], color="r")
使用不同的seaborn调色板。
>>> sns.set_color_codes("dark")
>>> _ = plt.plot([0, 1], color="g")
>>> _ = plt.plot([0, 2], color="m")