7

I'm looking for a way to plot 2d tabular data in a table-format(using Python), with the table-cells colored like a heatmap. Something like this:

http://www.r-bloggers.com/wp-content/uploads/2011/01/heat_copy.png.scaled.1000.jpg

I found quite a few examples for regular heatmaps using matplotlib - but not really something that produces output like in this link. Any hints appreciated.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Andy
  • 195
  • 1
  • 3
  • 8
  • 1
    What format do you want the output it? You describe a "plot", but what you link to seems like it would be better done not as a graphic but as a table with coloring (e.g., an HTML table with colored cells). – BrenBarn Jul 22 '12 at 00:03
  • BrenBarn: ideally something that works as inline output in IPython notebooks - i am not sure if a html table works? – Andy Jul 22 '12 at 00:15
  • Clarification: are you looking for (a) code to _produce_ the heatmap data (i.e. a matrix with a colour associated to each cell), (b) code to _format_ the heatmap data (i.e HTML tabular, IPython notebook, whatever) or (c) both? – Katriel Jul 22 '12 at 00:21
  • katrielalex: i have a pandas dataframe containing the data. Both really, for use in a Ipython notebook. Ideally it would use the index and column names as labels, and the ability to set axis titles would be nice too. Like a real matplotlib plot.. – Andy Jul 22 '12 at 00:29

0 Answers0