利用python pyheatmap包绘制热力图,供大家参考,具体内容如下
import matplotlib.pyplot as plt
from pyheatmap.heatmap import HeatMap
def plot_data(filename):
with open(filename,'r') as fh:
data=fh.read().split('\n')
xs = []
ys = []
data_test=[]
for line in data:
li
本文实例讲述了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])