Going through pandas and matplot lib examples
This commit is contained in:
16
normdist.py
Normal file
16
normdist.py
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/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()
|
||||
Reference in New Issue
Block a user