zoukankan      html  css  js  c++  java
  • 【python】使用pyheatmap.heatmap绘制热力图,入门版2

    python使用pyheatmap.heatmap制作热力图,代码传送门:

    # -*- 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(data)
    heat.clickmap(save_as="1.png") #点击图
    heat.heatmap(save_as="2.png") #热图
    

    效果图:

  • 相关阅读:
    命令[34]
    命令[33]
    命令[27]
    命令[38]
    命令[19]
    命令[22]
    命令[30]
    命令[37]
    命令[23]
    命令[26]
  • 原文地址:https://www.cnblogs.com/helenlee01/p/12617450.html
Copyright © 2011-2022 走看看