[R] comparing heatmaps

Peter Langfelder peter.langfelder at gmail.com
Tue Mar 29 04:58:40 CEST 2011


On Mon, Mar 28, 2011 at 6:36 PM, Benton, Paul
<hpaul.benton08 at imperial.ac.uk> wrote:
> Benno,
>
> That helps but it only makes the color bar symmetrical. I want to be able to compare 2 different heatmaps so that 0.7 (for example) is always the same tone of green and not shifted slightly. Is this possible?
>
> Paul

>From what I can see it is not possible with heatmap.2. If you are
looking for a function that can create a heatmap with a color legend,
you can try function image.plot in the package fields, or the function
labeledHeatmap in the package WGCNA. Neither of them has the
histogram-enhanced color legend, but labeledHeatmap definitely takes
an argument zlim which you can set to say c(-1, 1) to obtain a
consistent color scale, and the last time I used image.plot (which was
quite some time ago), that function also took that argument.

See examples listed in help(labeledHeatmap) for a few examples of what
it can do.

Peter



More information about the R-help mailing list