I have a pandas dataframe
with user information. I would like to plot the age of users as both a kind=\'kde\'
and on kind=\'hist\'
on
In case you want it for all the columns of your dataframe:
fig, ax = plt.subplots(8,3, figsize=(20, 50))
# you can change the distribution, I had 22 columns, so 8x3 is fine to me
fig.subplots_adjust(hspace = .2, wspace=.2, )
ax = ax.ravel()
for i in range(len(I_df.columns)):
ax[i] = I_df.iloc[:,i].plot(kind='hist', ax=ax[i])
ax[i] = I_df.iloc[:,i].plot(kind='kde', ax=ax[i], secondary_y=True)
plt.title(I_df.columns[i])
I hope it helps :)