欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

直方图

程序员文章站 2024-03-08 15:16:10
...
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()

直方图