import matplotlib.pyplot as plt import numpy as np import matplotlib.mlab as mlab import math mu = 0 variance = 1 sigma = math.sqrt(variance) x = np.linspace(mu - 3*sigma, mu + 3*sigma, 100) plt.plot(x, mlab.normpdf(x, mu, sigma)) plt.show()
import scipy, scipy.stats x = scipy.linspace(0,10,11) pmf = scipy.stats.binom.pmf(x,10,0.5) import pylab pylab.plot(x,pmf)