diff --git a/normdist.py b/normdist.py index ea3456d..db0dd72 100644 --- a/normdist.py +++ b/normdist.py @@ -4,12 +4,13 @@ import numpy as np import matplotlib.pyplot as plt from scipy.stats import norm -mean = 1 -stddev = 5 -lowerbound = -1 -upperbound = 1 -x = np.linspace(-10, 10 - , 1000) +data = np.array([1, 1.1, 0.9, 1, 1, 0.9, 0.9]) +lowerbound = 0.9 +upperbound = 1.0 + +mean = data.mean() +stddev = data.std() +x = np.linspace(mean-3*stddev, mean+3*stddev, 1000) y = norm.pdf(x, mean, stddev) plt.plot(x, y, 'b-', label='Normal Distribution') coloredregion = (x >= lowerbound) & ( x <= upperbound ) #select x values