关注于数据分析的小站

seaborn.set_color_codes

seaborn.set_color_codes(palette='deep')

Change how matplotlib color shorthands are interpreted.

Calling this will change how shorthand codes like “b” or “g” are interpreted by matplotlib in subsequent plots.

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

Named seaborn palette to use as the source of colors.

See also

Color codes can be set through the high-level seaborn style manager.Color codes can also be set through the function that sets the matplotlib color cycle.

Examples

Map matplotlib color codes to the default seaborn palette.

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

https://i0.wp.com/seaborn.pydata.org/_images/seaborn-set_color_codes-1.png

Use a different seaborn palette.

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

https://i0.wp.com/seaborn.pydata.org/_images/seaborn-set_color_codes-2.png

赞(0)
未经允许不得转载:0dayhub » seaborn.set_color_codes
分享到: 更多 (0)

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
%d 博主赞过: