pydata/pandas — pull request #5646 by olgabot (2013-12-05 06:30:52+00:00)
Title: Clustered heatmap

Hello there,
I'm working on a clustered heatmap figure for pandas, like R's `heatmap.2` which I used I ton when I was still in R-land.

I'm having some trouble wrapping my mind around `pandas.tools.plotting` but I have a draft version of this `heatmap` function with some initial parameters in my fork: https://github.com/olgabot/pandas/commit/4759d31666ca476a07c09a450e42a847abdc2b3d But I'm unsure how to proceed with plumbing this function into the current `pandas` plotting tools.

Here's a notebook of a simple and complex example: http://nbviewer.ipython.org/gist/olgabot/7801024

Also, unlike other many plotting functions, `heatmap` creates a whole figure. I currently return the `fig` instance along with the dendrogram objects for both the rows and columns in case the user wants to do some stats on them. It seems like for this function, accepting an `ax` argument (or even a `fig`) doesn't make any sense because there's at least 4 (up to 6 if you label columns or rows with colors) `ax` instances to create.

FYI besides adding documentation and tests and such I'm still working on:
* reasonable dendrogram sizing for when the dimensions are really large. Right now the dendrogram axis size is a proportion of the figure size, but this should change for even medium (100+) size datasets because then the dendrogram takes over the figure.
* Allowing for multiple colors labels for each row/column
* Adding optimal leaf ordering (important for time-dependent data)
* vmin/vmax for `pcolormesh`
* maybe add some padding between the dendrogram, colorbars, and heatmap?
* Other suggestions welcome!

I'm also still working through all the developer FAQs and such so I'm probably making tons of n00b mistakes so please point them out to me, especially if there are some pandas/python conventions I'm totally not following.