使用Python绘制热图的库 pyHeatMap

码农软件 · 软件分类 · 报表/图表制作 · 2019-08-20 16:12:11

软件介绍

这是一个生成热图的小程序,基于 Python 和 PIL 开发。

程序截图:

点击图

点击图

热图

热图

安装:

通过 pip 安装:

pip install pyheatmap

通过 easy_install 安装:

easy_install pyheatmap

通过源码安装:

git clone git://github.com/oldj/pyheatmap.git
cd pyheatmap
python setup.py install

使用示例:

# -*- coding: utf-8 -*-

import urllib
from pyheatmap.heatmap import HeatMap

def main():

    # 下载测试数据
    url = "https://raw.github.com/oldj/pyheatmap/master/examples/test_data.txt"
    sdata = urllib.urlopen(url).read().split("\n")
    data = []
    for ln in sdata:
        a = ln.split(",")
        if len(a) != 2:
            continue
        a = [int(i) for i in a]
        data.append(a)

    # 开始绘制
    hm = HeatMap(data)
    hm.clickmap(save_as="hit.png")
    hm.heatmap(save_as="heat.png")

if __name__ == "__main__":
    main()

本文地址:https://www.codercto.com/soft/d/12789.html

HTML5

HTML5

Matthew David / Focal Press / 2010-07-29 / USD 39.95

Implement the powerful new multimedia and interactive capabilities offered by HTML5, including style control tools, illustration tools, video, audio, and rich media solutions. Understand how HTML5 is ......一起来看看 《HTML5》 这本书的介绍吧!

在线进制转换器
在线进制转换器

各进制数互转换器

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具