mu = 100 # mean of distribution
sigma = 20 # standard devition of distribution
x = mu + sigma*np.random.randn(2000)
plt.hist(x,bins=50,color="red",normed=False)
plt.show()
结果:
x = np.random.randn(1000)+2
y = np.random.randn(1000)+3
plt.hist2d(x,y,bins=40)
plt.show()