如何在使用seaborn时增加python中的绘图大小

时间:2017-07-12 15:13:49

标签: python matplotlib seaborn

我创建了一些配对图但似乎无法增加绘图区域。代码和输出如下所示,以供参考。 请在下面找到数据的快照。 enter image description here 有人可以帮我这个。 enter image description here

2 个答案:

答案 0 :(得分:2)

您必须在pairplot(或其他绘图)命令中指定大小。

plt.figure()
sns.pairplot(attrition_df, size=2.5, aspect=1)

size等于facet(subplot)的高度(以英寸为单位),以英寸为单位的宽度等于aspect*size

答案 1 :(得分:2)

pairplotsize选项,可以控制每个方面的大小(以英寸为单位)。

来自pairplot docs

  

大小:标量,可选

     

每个方面的高度(以英寸为单位)。

改变它将控制子图的大小,以及整体图形大小,例如

sns.pairplot(attrition_df, size=3, ...)