Skip to content

Instantly share code, notes, and snippets.

@aita
Created July 1, 2013 08:40
Show Gist options
  • Select an option

  • Save aita/5899303 to your computer and use it in GitHub Desktop.

Select an option

Save aita/5899303 to your computer and use it in GitHub Desktop.
標本分布
import matplotlib.mlab as mlab
import matplotlib.pyplot as plt
import numpy as np
sample = 10000
mu, std = 0, 10
data = [np.mean(np.random.normal(mu, std, sample)) for x in range(sample)]
n, bins, patches = plt.hist(data, bins=50, normed=True)
line = mlab.normpdf(bins, np.mean(data), np.std(data))
plt.plot(bins, line, 'r--', linewidth=1)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment