17 lines
439 B
Python
17 lines
439 B
Python
#!/usr/bin/env python
|
|
# From https://www.geeksforgeeks.org/python/how-to-plot-a-normal-distribution-with-matplotlib-in-python/
|
|
import numpy as np
|
|
import matplotlib.pyplot as plt
|
|
from scipy.stats import norm
|
|
|
|
mean = 1
|
|
stddev = 5
|
|
x = np.linspace(-10, 10
|
|
, 1000)
|
|
plt.plot(x, norm.pdf(x, mean, stddev), 'b-', label='Normal Distribution')
|
|
plt.xlabel('X')
|
|
plt.ylabel('Probability Density')
|
|
plt.legend()
|
|
plt.grid(True)
|
|
plt.show()
|