I am trying to create distplot of a dataframe grouped by a column
data_plot = creditcard_df.copy()
amount = data_plot['Amount']
data_plot.drop(labels=['Amount'], axis=1, inplace = True)
data_plot.insert(0, 'Amount', amount)
# Plot the distributions of the features
columns = data_plot.iloc[:,0:30].columns
plt.figure(figsize=(12,30*4))
grids = gridspec.GridSpec(30, 1)
for grid, index in enumerate(data_plot[columns]):
ax = plt.subplot(grids[grid])
sns.distplot(data_plot[index][data_plot.Class == 1], hist=False, kde_kws={"shade": True}, bins=20)
sns.distplot(data_plot[index][data_plot.Class == 0], hist=False, kde_kws={"shade": True}, bins=20)
ax.set_xlabel("")
ax.set_title("Distribution of Column: " + str(index))
plt.show()
I tried to use a log scale for the y axis, change the gridspec, and the figsize; but all of those only made a mess of the distributions.
Is there a way to make the plots uniform?