diff --git a/normdist.py b/normdist.py index 00cb33b..b7681bc 100644 --- a/normdist.py +++ b/normdist.py @@ -20,6 +20,7 @@ fig, ax = plt.subplots() textstr = '\n'.join(( r'$n=%d$' % (len(data)), r'$\mu=%.2f$' % (mean, ), + r'$\sigma=%.2f$' % (stddev, ), r'$P=%.2f$' % (prob, ), r'$I=%.2f$ bits' % (info, ))) # these are matplotlib.patch.Patch properties @@ -30,7 +31,7 @@ ax.text(0.05, 0.95, textstr, transform=ax.transAxes, fontsize=14, verticalalignment='top', bbox=props) x = np.linspace(mean-3*stddev, mean+3*stddev, 500) -y = norm.pdf(x, mean, stddev) +y = norm.pdf(x, loc=mean, scale=stddev) * stddev#rescale back to unity area plt.axvline(x=mean, color="green", linestyle="dashed", label="mean") plt.axvline(lowerbound, color="red") plt.axvline(upperbound, color="red")