How to plot kernel density plot on a given histogram plot?

ipython

#1

I am currently trying to plot a density plot from a given histogram plot.
Density plot- Is formed by computing an estimate of a continuous probability distribution that might have generated from the observed data.
Do I want to know how this can achieve in python?

comp1 = np.random.normal(0, 1, size=200) # N(0, 1)
comp2 = np.random.normal(10, 2, size=200) # N(10, 4)
values = Series(np.concatenate([comp1, comp2]))
values.hist(bins=100, alpha=0.3, color=‘k’, normed=True)


#2

@sid100158 - You can plot kernel density plot by changing the kind argument to** kde** .

comp1 = np.random.normal(0, 1, size=200) # N(0, 1)
comp2 = np.random.normal(10, 2, size=200) # N(10, 4)
values = Series(np.concatenate([comp1, comp2]))
values.hist(bins=100, alpha=0.3, color=‘k’, normed=True)
values.plot(kind=‘kde’, style=‘k–’)

Hope this helps!

Regards,
Hinduja