A heatmap is a way of visualizing a matrix: Pandas [Feature Request]: df.plot(type='heatmap')

It's particularly common in biology / bioinformatics. It makes for a good way to begin to form hypotheses about the latent structure in some data.

There exists a library which can produce heatmaps in python, specifically seaborn. However, the fact this feature already exists in another library doesn't necessarily mean it shouldn't exist here -- after all, both libraries provide bar plots, scatter plots, etc... And secondly, the seaborn implementation is very slow relative to R's heatmap plotting, so there's room for a faster implementation in the python world.

I'd love to see a new, faster heatmap implementation added to pandas. Would make my life much, much easier.

Comment From: jreback

can you point to the code that implements this in seaborn? (for reference)

Comment From: alexlenail

https://github.com/mwaskom/seaborn/blob/0beede57152ce80ce1d4ef5d0c0f1cb61d118375/seaborn/matrix.py

Comment From: jreback

xref https://github.com/pandas-dev/pandas/issues/8911 and #15204

Comment From: alexlenail

@jreback Thanks for adding in the history. I'm sorry I didn't check myself before opening the issue.

Seaborn is quite good at visualizing heatmaps in the < 100 x 100 cells range. Starting around there, the code becomes prohibitively slow, usually crashing after a couple minutes of standstill.

I'm not sure how it would be possible to add a better heatmap function, but it's clearly possible since R has a function which doesn't even blink when given 1000 x 1000. This might be an intrinsic issue with matplotlib (suggesting we would need to circumvent it with some C) or it might not (in which case we would just need to write some optimized matplotlib code). I haven't looked into it deep enough.

Comment From: mroeschke

Thanks for the request, but since seaborn provides this functionality pretty easily and there hasn't been additional community or core dev interest over the years going to close for now. Can open if there's renewed interest from both parties