# [R] Fwd: comparing heatmaps

From: Benton, Paul <hpaul.benton08_at_imperial.ac.uk>
Date: Tue, 29 Mar 2011 16:37:51 +0100

Thanks Tom.

heatmap.2(mat, Rowv=NA, Colv=NA, col=redgreen, breaks=seq(-1,1,by=0.01), symm=TRUE, trace="none", dendrogram="none")

that did the trick :)

Begin forwarded message:

From: "Leja, Thomas"
Date: 29 March 2011 03:47:59 GMT+01:00
To: "Benton, Paul"
Subject: Re: [R] comparing heatmaps

Yep, you have to specify the range for colours.

I usually plot the correlations from 0 to 1. Just add "breaks" option and colour without the gradient: col=redgreen, breaks=seq(0,1,by=0.1),

Hope this helps :)

Best,

Thomas

From: "Benton, Paul"
Date: 29 March 2011 02:36:02 GMT+01:00
To: "<mailto:R-help_at_r-project.org>R-help_at_r-project.org<mailto:R-help_at_r-project.org>" <<mailto:R-help_at_r-project.org>R-help_at_r-project.org<mailto:R-help_at_r-project.org>> Subject: Re: [R] comparing heatmaps

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

[[alternative HTML version deleted]]

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. Received on Tue 29 Mar 2011 - 15:39:50 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 29 Mar 2011 - 16:10:25 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.