The following code plots three normalized Gaussian functions with different standard deviations.
import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(-6, 6, 1000)
def gaussian(x, sigma):
""" Return the normalized Gaussian with standard deviation sigma. """
c = np.sqrt(2 * np.pi)
return np.exp(-0.5 * (x / sigma)**2) / sigma / c
sigma1, sigma2, sigma3 = 1, 1.5, 2
g1, g2, g3 = gaussian(x, sigma1), gaussian(x, sigma2), gaussian(x, sigma3)
plt.plot(x, g1)
plt.plot(x, g2)
plt.plot(x, g3)
plt.show()