Answer the question in the comments: How to draw everything in one shape? I also show an alternative method for viewing graphs in the console, one below the other.
import matplotlib.pyplot as plt
df1 = df.select_dtypes([np.int, np.float])
n=len(df1.columns)
fig,ax = plt.subplots(n,1, figsize=(6,n*2), sharex=True)
for i in range(n):
plt.sca(ax[i])
col = df1.columns[i]
sns.countplot(df1[col].values)
ylabel(col);
Notes:
- if the range of values in your columns is different - set sharex = False or delete it
- no headers needed: seaborn automatically inserts column names as xlabel
- for compact presentation, change xlabels to ylabel, as in the code snippet
source
share