【发布时间】:2014-06-27 19:43:20
【问题描述】:
我有以下代码绘制点然后绘制直方图:
# Produce a number of points in x-y from 1 distribution.
mean = [3,4]
cov = [[3,1],[1,3]]
x,y = np.random.multivariate_normal(mean,cov,1000).T
plt.plot(x,y,'x'); plt.axis('equal'); plt.show()
Z = np.array([x,y])
# Produce 2D histogram projection
H,xedges,yedges = np.histogram2d(x,y,10,normed=False)
X,Y = np.meshgrid(xedges,yedges)
plt.imshow(H)
plt.grid(True)
我只是希望 imshow() 上的直方图更块状而不是如此模糊,以便每个方形箱的密度更清晰。我不知道该怎么做。
【问题讨论】:
标签: python matplotlib histogram