简体   繁体   中英

How to increase the plot size in python while using seaborn

I have created some pairplots but cannot seem to increase the area of the plot.The code and the output are shown below for reference. Please find below a snapshot of the data. 在此处输入图片说明 Can someone please help me with this. 在此处输入图片说明

You have to specify the size in the pairplot (or other plot) command.

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

size equals the height of the facet (subplot) in inches, and the width in inches equals aspect*size

pairplot has the option size , which controls the size, in inches, of each facet.

From the pairplot docs :

size : scalar, optional

Height (in inches) of each facet.

Altering this will control the size of the subplots, and also the overall figure size, eg

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM