打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
Python之seaborn:利用seaborn的color_palette()函数改变绘图界面风格

Python之seaborn:利用seaborn的color_palette()函数改变绘图界面风格


利用seaborn的color_palette()函数改变绘图界面风格

实现结果

sns.set_style('ticks')   #默认五种风格:darkgrid,whitegrid,dark,white,ticks

源代码解释

def set_style Found at: seaborn.rcmod

def set_style(style=None, rc=None):

    """Set the aesthetic style of the plots.

    This affects things like the color of the axes, whether a grid is enabled by default, and other aesthetic elements.

    Parameters

    ----------

    style : dict, None, or one of {darkgrid, whitegrid, dark, white, ticks}. A dictionary of parameters or the name of a preconfigured set.

    rc : dict, optional. Parameter mappings to override the values in the preset seaborn style dictionaries. This only updates parameters that are considered part of the style definition.

设定了绘图的美学风格。

这将影响轴的颜色、是否默认启用网格以及其他美学元素。

参数

----------

style : dict,无,或一个{darkgrid,暗网格,whitegrid白格子,dark黑,white白,ticks}。参数的字典或预先配置的参数集的名称。

rc: dict,可选。参数映射,以覆盖预设的seaborn样式字典中的值。这只更新被认为是样式定义的一部分的参数。

    Examples

    --------

    >>> set_style("whitegrid")

    >>> set_style("ticks", {"xtick.major.size": 8, "ytick.major.size": 8})

    See Also

    --------

    axes_style : return a dict of parameters or use in a ``with`` statement to temporarily set the style.

    set_context : set parameters to scale plot elements

    set_palette : set the default color palette for figures

    """

    style_object = axes_style(style, rc)

    mpl.rcParams.update(style_object)

axes_style: 返回一组参数或在' ' with ' '语句中使用来临时设置样式。

set_context: 设置参数来缩放图形元素。

set_palette: 设置图形的默认调色板。

    Examples

    --------

    >>> set_style("whitegrid")

    >>> set_style("ticks", {"xtick.major.size": 8, "ytick.major.size": 8})

 

    See Also

    --------

    axes_style : return a dict of parameters or use in a ``with`` statement to temporarily set the style.

    set_context : set parameters to scale plot elements

    set_palette : set the default color palette for figures

    """

    style_object = axes_style(style, rc)

    mpl.rcParams.update(style_object)

 
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
seaborn绘图风格的设置
Python Seaborn (1) 艺术化的图表控制
Seaborn从零开始学习教程(一)
【量化】seaborn在金融数据可视化中的应用
十分钟掌握Seaborn,进阶Python数据可视化分析
Python绘图库之Seaborn(一)
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服