Skip to main content
Warning: You are using the test version of PyPI. This is a pre-production deployment of Warehouse. Changes made here affect the production instance of TestPyPI (
Help us improve Python packaging - Donate today!

Heatmap cluster dendrogram plotter.

Project Description

heatmapcluster is a python library for generating a clustered heatmap with dendrograms plotted along with the heatmap, such as the following:

This is prototype-quality software. The documentation is sparse, and the API will likely change.

Plots are generated with matplotlib ( To use the package, numpy, scipy and matplotlib must be installed.

setuptools is required to install the package using


This is Most of the code is the function make_data, which generates an array of data for the demonstration. The main part of the demo is the last three statements of the script. This script generates the plot shown above:

import numpy as np
import matplotlib.pyplot as plt
from heatmapcluster import heatmapcluster

def make_data(size, seed=None):
    if seed is not None:

    s = np.random.gamma([7, 6, 5], [6, 8, 6], size=(size[1], 3)).T
    i = np.random.choice(range(len(s)), size=size[0])
    x = s[i]

    t = np.random.gamma([8, 5, 6], [3, 3, 2.1], size=(size[0], 3)).T
    j = np.random.choice(range(len(t)), size=size[1])

    x += 1.1*t[j].T

    x += 2*np.random.randn(*size)

    row_labels = [('R%02d' % k) for k in range(x.shape[0])]
    col_labels = [('C%02d' % k) for k in range(x.shape[1])]

    return x, row_labels, col_labels

x, row_labels, col_labels = make_data(size=(64, 48), seed=123)

h = heatmapcluster(x, row_labels, col_labels,
                   num_row_clusters=3, num_col_clusters=0,

Release History

This version
History Node


History Node


History Node


Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(6.3 kB) Copy SHA256 Hash SHA256
Wheel py2.py3 Jan 14, 2017

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers DreamHost DreamHost Log Hosting