"""
Make a histogram of normally distributed random numbers
simplified version of
http://matplotlib.sourceforge.net/examples/api/histogram_demo.html
"""
import numpy as np
import matplotlib.pyplot as plt
# create data with normal distribution with given mean and standard deviation
mu = 100
sigma = 15
x = mu + sigma * np.random.randn(10000)
fig = plt.figure()
ax = fig.add_subplot(111)
# the histogram of the data
n, bins, patches = ax.hist(x, 50, normed=1, facecolor='green', alpha=0.75)
ax.set_xlabel('Smarts')
ax.set_ylabel('Probability')
# set the x and y limits
#ax.set_xlim(40, 160)
#ax.set_ylim(0, 0.03)
# show grid-lines
ax.grid(True)
fig.show()
