日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程语言 > python >内容正文

python

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

發(fā)布時(shí)間:2025/3/21 python 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Python之seaborn:利用seaborn的color_palette()函数改变绘图界面风格 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

Python之seaborn:利用seaborn的color_palette()函數(shù)改變繪圖界面風(fēng)格

?

?

目錄

利用seaborn的color_palette()函數(shù)改變繪圖界面風(fēng)格

實(shí)現(xiàn)結(jié)果

源代碼解釋


?

?

?

?

利用seaborn的color_palette()函數(shù)改變繪圖界面風(fēng)格

實(shí)現(xiàn)結(jié)果

sns.set_style('ticks') #默認(rèn)五種風(fēng)格: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.

?

?

?

?

?

?

設(shè)定了繪圖的美學(xué)風(fēng)格。

?

這將影響軸的顏色、是否默認(rèn)啟用網(wǎng)格以及其他美學(xué)元素。

?

參數(shù)

----------

style :?dict,無,或一個(gè){darkgrid,暗網(wǎng)格,whitegrid白格子,dark黑,white白,ticks}。參數(shù)的字典或預(yù)先配置的參數(shù)集的名稱。

rc: dict,可選。參數(shù)映射,以覆蓋預(yù)設(shè)的seaborn樣式字典中的值。這只更新被認(rèn)為是樣式定義的一部分的參數(shù)。

????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:?返回一組參數(shù)或在' ' with ' '語句中使用來臨時(shí)設(shè)置樣式。

set_context:?設(shè)置參數(shù)來縮放圖形元素。

set_palette:?設(shè)置圖形的默認(rèn)調(diào)色板。

????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)

?

?

?

?

總結(jié)

以上是生活随笔為你收集整理的Python之seaborn:利用seaborn的color_palette()函数改变绘图界面风格的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。