import numpy as np import matplotlib.pyplot as plt # Fixing random state for reproducibility np.random.seed(19680325) N = 1000000 mu, sigma = 100, 15 x = mu + sigma * np.random.randn(N) print(x) # the histogram of the data n, bins, patches = plt.hist(x, 100, density=1, facecolor='b', alpha=0.75) plt.xlabel('IQ') plt.ylabel('Probability') plt.title('Histogram of IQ') plt.text(60, .025, r'$\mu=100,\ \sigma=15$') plt.axis([40, 160, 0, 0.03]) plt.grid(True) plt.show()