本文实例讲述了Python绘制热力图操作。分享给大家供大家参考,具体如下:
示例一:
# -*- coding: utf-8 -*-
from pyheatmap.heatmap import HeatMap
import numpy as np
N = 10000
X = np.random.rand(N) * 255 # [0, 255]
Y = np.random.rand(N) * 255
data = []
for i in range(N):
tmp = [int(X[i]), int(Y[i]), 1]
data.append(tmp)
heat = HeatMap(
1