這里我推薦下 python 的 seaborn 庫(kù),主要用于數(shù)據(jù)可視化,使用起來(lái)非常簡(jiǎn)單。
下面演示下簡(jiǎn)單用法,假設(shè)已經(jīng)安裝python包和環(huán)境管理工具conda.
# 創(chuàng)建環(huán)境
conda create -n visualization python=3.9 matplotlib seaborn
# 導(dǎo)入包
# importing packages
import seaborn as sns
import matplotlib.pyplot as plt
# 載入數(shù)據(jù)
# loading dataset
data = sns.load_dataset('iris')
# 畫圖并顯示
sns.pairplot(data=data, hue='species')
plt.show()
效果如下圖所示,
下面是 seaborn 官網(wǎng)的應(yīng)用示例,參考下。
聯(lián)系客服