I am using the following script to plot the probability density curve but it only shows the histogram as a function of density. May someone suggest to me how can I get the probability density curve.
from matplotlib import pyplot
from numpy.random import normal
from numpy import mean[enter image description here][1]
from numpy import std
from scipy.stats import norm
data = pd.read_csv("a.txt", sep='\t',header=None)
sample = data[0]
sample_mean = mean(sample)
sample_std = std(sample)
dist = norm(sample_mean, sample_std)
values = [value for value in range(0, 1)]
probabilities = [dist.pdf(value) for value in values]
pyplot.hist(sample, bins=10, density=True)
plt.xlim(0,1)
pyplot.plot(values, probabilities, 'r')
pyplot.show()