Skip to content

Latest commit

 

History

History
80 lines (45 loc) · 1.36 KB

README.md

File metadata and controls

80 lines (45 loc) · 1.36 KB

#pyHeatMap

pyHeatMap is a Python library for painting heat maps. It depends on PIL.

##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 -*-

import urllib
from pyheatmap.heatmap import HeatMap

def main():

    # download test data
    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)

    # 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 LGPL open source license.

##Update

  • 2012-09-03 Create.