[R] comparing heatmaps

Benton, Paul hpaul.benton08 at imperial.ac.uk
Tue Mar 29 03:36:02 CEST 2011


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

On 28 Mar 2011, at 10:42, Benno Pütz wrote:

> 
> On 27.Mrz.2011, at 22:54, Benton, Paul wrote:
> 
>> library(gplots)
>> dat<-cor(matrix(rnorm(100, m=10), nrow=10))
>> mat<-cor(matrix(rnorm(100), nrow=10))
>> dev.new()
>> heatmap.2(mat, Rowv=NA, Colv=NA, col=redgreen(75), symm=TRUE, trace="none", dendrogram="none",
>> 				main = paste("Correlation Matrix for time delay at ", sep=""))
>> dev.new()
>> heatmap.2(dat, Rowv=NA, Colv=NA, col=redgreen(75), symm=TRUE, trace="none", dendrogram="none",
>> 				main = paste("Correlation Matrix for time delay at ", sep=""))
> In this case adding
> 
> 	symkey = TRUE
> 
> to the heatmap.2 calls should help
> 
> 	Benno



More information about the R-help mailing list