matplotlib--heatmap

热图表示三维数据

1.

plt.figure()

Y = np.random.normal(loc=0.0, scale=1.0, size=10000)
X = np.random.random(size=10000)
_ = plt.hist2d(X, Y, bins=25)

2.改变bin的数量

plt.figure()
_ = plt.hist2d(X, Y, bins=100)

# add a colorbar legend
plt.colorbar()

posted @ 2018-08-24 16:47  卷积  阅读(384)  评论(0编辑  收藏  举报