Seaborn 的默认图形大小是多少?

What is Seaborn's default figure size?

我可以找到很多关于如何更改 Seaborn 的身材尺寸的答案。我想知道:默认图形大小是多少?

我相信 seaborn 在绘制轴时使用 matplotlib 的默认参数,因此您可以使用 matplotlib.rcParams.

检查 figsize
import matplotlib
matplotlib.rcParams['figure.figsize']
# [12.0, 7.0]

import seaborn as sns
import pandas as pd

df = pd.DataFrame(columns=['x','y'])
ax = sns.scatterplot(data=df, x="x", y="x")
ax.figure.get_size_inches()
# array([12.,  7.])

现在对于生成图形的高级绘图函数,这是由函数定义的。

例如relplot, displot... have a default parameter of height=5 (inches) and aspect=1, which translates into a figsize of [5,5] for a single subplot/facet, and proportionally more for several cols/rows in the FacetGrid.

pairplot has a default of height=2.5 and jointplot,共 height=6