python heat map library
Python
Latest commit de99bf8 Oct 31, 2016 @oldj update requires.
Permalink
Failed to load latest commit information.
examples 兼容 python 2/3。 Aug 30, 2015
pyheatmap 修复一处兼容问题。 Oct 31, 2016
.gitignore update ignore rule. Aug 30, 2015
README.md 修复一处兼容问题。 Oct 31, 2016
requirements.txt update requirements. Jan 18, 2016
setup.py update requires. Oct 31, 2016

README.md

pyHeatMap

pyHeatMap is a Python library for painting heat maps. It depends on Pillow. Python 2/3 compatible.

Screenshots

hit map

hit map

heat map

heat map

Install

by pip:

pip install pyheatmap

by easy_install:

easy_install pyheatmap

from source code:

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

Example:

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

from pyheatmap.heatmap import HeatMap
import requests

def main():

    # download test data
    url = "https://raw.github.com/oldj/pyheatmap/master/examples/test_data.txt"
    sdata = requests.get(url).text.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)

    # start painting
    hm = HeatMap(data)
    hm.clickmap(save_as="hit.png")
    hm.heatmap(save_as="heat.png")

if __name__ == "__main__":
    main()

Copyright

This library is free and is provided under the MIT open source license.

Update

  • 2015-08-31 Python 2/3 compatible.
  • 2012-09-03 Create.