1 plt.figure()
2 
3 Y = np.random.normal(loc=0.0, scale=1.0, size=10000)
4 X = np.random.random(size=10000)
#bins设置区间大小
5 _ = plt.hist2d(X, Y, bins=25)

1 plt.figure()
2 _ = plt.hist2d(X, Y, bins=100)
3 
4 # 加上颜色的标注
5 plt.colorbar()

 

posted on 2018-03-09 20:40  郑哲  阅读(193)  评论(0编辑  收藏  举报