[R] comparing heatmaps

Alex Gutteridge alexg at ruggedtextile.com
Tue Mar 29 12:40:36 CEST 2011


 On Mon, 28 Mar 2011 19:58:40 -0700, Peter Langfelder wrote:
> 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
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide 
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

 Perhaps I misunderstand, but the color scale can be explicitly defined 
 in heatmap.2 using the breaks argument.

-- 
 Alex Gutteridge



More information about the R-help mailing list