如何在Seaborn中更改重新绘制的地块大小?
发布于 2021-01-29 16:34:54
与fig.set_size_inches(18.5, 10.5)
matplotlib相似。
关注者
0
被浏览
41
1 个回答
-
您可以先声明
fig, ax
对plt.subplots()
,然后在该图上设置适当的大小,然后要求sns.regplot
在该图上进行绘制ax
import numpy as np import seaborn as sns import matplotlib.pyplot as plt # some artificial data data = np.random.multivariate_normal([0,0], [[1,-0.5],[-0.5,1]], size=100) # plot sns.set_style('ticks') fig, ax = plt.subplots() fig.set_size_inches(18.5, 10.5) sns.regplot(data[:,0], data[:,1], ax=ax) sns.despine()