Fixed the y-scaling problem
This commit is contained in:
@@ -20,6 +20,7 @@ fig, ax = plt.subplots()
|
|||||||
textstr = '\n'.join((
|
textstr = '\n'.join((
|
||||||
r'$n=%d$' % (len(data)),
|
r'$n=%d$' % (len(data)),
|
||||||
r'$\mu=%.2f$' % (mean, ),
|
r'$\mu=%.2f$' % (mean, ),
|
||||||
|
r'$\sigma=%.2f$' % (stddev, ),
|
||||||
r'$P=%.2f$' % (prob, ),
|
r'$P=%.2f$' % (prob, ),
|
||||||
r'$I=%.2f$ bits' % (info, )))
|
r'$I=%.2f$ bits' % (info, )))
|
||||||
# these are matplotlib.patch.Patch properties
|
# 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)
|
verticalalignment='top', bbox=props)
|
||||||
|
|
||||||
x = np.linspace(mean-3*stddev, mean+3*stddev, 500)
|
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(x=mean, color="green", linestyle="dashed", label="mean")
|
||||||
plt.axvline(lowerbound, color="red")
|
plt.axvline(lowerbound, color="red")
|
||||||
plt.axvline(upperbound, color="red")
|
plt.axvline(upperbound, color="red")
|
||||||
|
|||||||
Reference in New Issue
Block a user