Note that there are some explanatory texts on larger screens.

plurals
  1. POR: Which heatmap/image to get row-sorted plot without any dendrogram?
    text
    copied!<p>Which package is best for a <strong>heatmap/image with sorting on rows only, but don't show any dendrogram or other visual clutter (just a 2D colored grid with automatic named labels on both axes)</strong>. I don't need fancy clustering beyond basic numeric sorting. The data is a 39x10 table of numerics in the range (0,0.21) which I want to visualize.</p> <p>I searched SO (see <a href="https://stackoverflow.com/questions/5638462/r-image-of-a-pixel-matrix">this</a>) and the R sites, and tried a few out. Check out <a href="http://rgm2.lab.nig.ac.jp/RGM2/search.php?query=heatmap" rel="nofollow noreferrer">R Graphical Manual</a> to see an excellent searchable list of screenshots and corresponding packages.</p> <p>The range of packages is confusing - which one is the preferred heatmap (like <em>ggplot2</em> is for most other plotting)? Here is what I found out so far:</p> <ul> <li><a href="https://stackoverflow.com/questions/5638462/r-image-of-a-pixel-matrix">base::image</a> - bad, no name labels on axes, no sorting/clustering</li> <li><a href="http://flowingdata.com/2010/01/21/how-to-make-a-heatmap-a-quick-and-easy-solution/" rel="nofollow noreferrer">base::heatmap</a> - options are far less intelligible than the following:</li> <li><a href="http://cran.r-project.org/web/packages/pheatmap/index.html" rel="nofollow noreferrer">pheatmap::pheatmap</a> - fantastic but can't seem to turn off the dendrograms? (any hacks?) </li> <li><a href="http://learnr.wordpress.com/2010/01/26/ggplot2-quick-heatmap-plotting/" rel="nofollow noreferrer">ggplot2 people use geom_tile, as Andrie points out</a></li> <li><a href="http://www.compbiome.com/2010/04/r-heatmaps-with-gplots.html" rel="nofollow noreferrer">gplots::heatmap.2</a> , <a href="http://cran.r-project.org/web/packages/gplots/index.html" rel="nofollow noreferrer">ref</a> - seems to be favored by biotech people, but way overkill for my purposes. (no relation to <em>ggplot*</em> or Prof Wickham)</li> <li><a href="http://rgm2.lab.nig.ac.jp/RGM2/images.php?show=all&amp;query=package:plotrix" rel="nofollow noreferrer">plotrix::color2D.matplot</a> also exists</li> </ul> <p><em><code>base::heatmap</code></em> is annoying, even with args <em><code>heatmap(..., Colv=NA, keep.dendro=FALSE)</code></em> it still plots the unwanted dendrogram on rows.</p> <p>For now I'm going with <em><code>pheatmap(..., cluster_cols=FALSE, cluster_rows=FALSE)</code></em> and manually presorting my table, like this guy: <a href="https://stackoverflow.com/questions/5320814/order-of-rows-in-heatmap">Order of rows in heatmap?</a></p> <p>Addendum: to display the value inside each cell, see: <a href="https://stackoverflow.com/questions/3789549/display-a-matrix-including-the-values-as-a-heatmap">display a matrix, including the values, as a heatmap</a> . I didn't need that but it's nice-to-have.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload