seaborn庫的簡介
Seabn是一個在Python中制作有吸引力和豐富資訊的統計圖形的庫。它建構在MatPultLB的頂部,與PyDATA棧緊密內建,包括對SIMPY和BANDA資料結構的支援以及SISPY和STATSMODEL的統計例程。
Seaborn 其實是在matplotlib的基礎上進行了更進階的 API 封裝,進而使得作圖更加容易 在大多數情況下使用seaborn就能做出很具有吸引力的圖,而使用matplotlib就能制作具有更多特色的圖。應該把Seaborn視為matplotlib的補充。Seabn是基于MatPultLB的Python可視化庫。它為繪制有吸引力的統計圖形提供了一個進階接口。
Official seaborn tutorial
Seaborn 官方介紹
seaborn: statistical data visualization
seaborn提供的一些特點是
在預設MatMattLIB美學中改進的幾個内置主題:
1、選擇顔色調色闆的工具來繪制資料中的模式
2、用于可視化單變量和二變量分布或用于在資料子集之間進行比較的功能
3、拟合和可視化不同類型獨立變量和因變量的線性回歸模型的工具
4、可視化資料矩陣并使用聚類算法發現這些矩陣中的結構的函數
5、一種靈活估計統計時間序列資料的函數及其估計的不确定性表示
6、構造抽象網格的進階抽象,讓您輕松地建構複雜的可視化
seaborn庫的安裝
pip install seaborn
seaborn庫的使用方法
0、相關文章
Py之matplotlib:matplotlib、seaborn兩種庫繪圖(封裝函數)最強總結
1、案例應用
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
sns.set( palette="muted", color_codes=True)
rs = np.random.RandomState(10)
d = rs.normal(size=100)
f, axes = plt.subplots(2, 2, figsize=(7, 7), sharex=True)
plt.title('seaborn: statistical data visualization')
sns.distplot(d, kde=False, color="b", ax=axes[0, 0])
sns.distplot(d, hist=False, rug=True, color="r", ax=axes[0, 1])
sns.distplot(d, hist=False, color="g", kde_kws={"shade": True}, ax=axes[1, 0])
sns.distplot(d, color="m", ax=axes[1, 1])
plt.show()
參考官網:
seaborn 0.8.1