Seaborn

Seaborn的diag_kind参数如何使用

小亿
87
2024-05-15 17:13:18
栏目: 编程语言

在Seaborn中,diag_kind参数用于指定对角线上的绘图类型,主要用于PairGrid对象和pairplot函数中。其常用取值包括:

例如,可以通过设置diag_kind参数为"hist"来在PairGrid对象中对角线上绘制直方图:

import seaborn as sns
import matplotlib.pyplot as plt

iris = sns.load_dataset("iris")
g = sns.PairGrid(iris)
g.map_diag(sns.histplot, diag_kind="hist")
plt.show()

0
看了该问题的人还看了