From f6c9433636cc9b63e985a2cc712ba6e0613efe19 Mon Sep 17 00:00:00 2001 From: Joseph Timothy Foley Date: Fri, 12 Dec 2025 10:19:41 +0000 Subject: [PATCH] statistic added, plotrange based on stddev --- normdist.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) 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