In [1]:
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.mlab as mlab

In [2]:
mu = 100
sigma = 15
x = mu + sigma * np.random.randn(10000)

num_bins = 50
n, bins, patches = plt.hist(x, num_bins, normed=1,facecolor='green', alpha=0.5)
y = mlab.normpdf(bins,mu,sigma)
plt.plot(bins,y,'r--')
plt.xlabel('smarts')
plt.ylabel('probability')
plt.title(r'histogram of IQ: $\mu=100$, $\sigma=15$')

plt.subplots_adjust(left=0.15)
plt.show()

In [ ]: