heatmap.2 with different colour ranges
1
0
Entering edit mode
Wendy Qiao ▴ 360
@wendy-qiao-4501
Last seen 9.6 years ago
Hi all, I have a matrix with values between 0 and 1. I want to plot this matrix on a heat map so anything >0.05 is blue, anything <=0.05 and >0.01 is yellow, and anything else is grey. I am using the heatmap.2 function. I searched around but did not find an efficient way to set colour ranges as I described. Could anybody give some hints? Thank you in advance. Wendy [[alternative HTML version deleted]]
• 2.5k views
ADD COMMENT
0
Entering edit mode
Mercier Eloi ▴ 60
@mercier-eloi-4685
Last seen 9.6 years ago
Hi Wendy, Simply define the breaks for the colours. Something like that : mat = matrix(runif(100,0,1), ncol=10) heatmap.2(mat, breaks=c(0,0.01,0.05,1), col=c("grey", "yellow", "blue"), dendrogram="none", trace="none") Eloi On 12-02-27 08:25 AM, Wendy Qiao wrote: > Hi all, > > I have a matrix with values between 0 and 1. I want to plot this matrix on > a heat map so anything>0.05 is blue, anything<=0.05 and>0.01 is yellow, > and anything else is grey. I am using the heatmap.2 function. I searched > around but did not find an efficient way to set colour ranges as I > described. Could anybody give some hints? Thank you in advance. > > Wendy > > [[alternative HTML version deleted]] > > _______________________________________________ > Bioconductor mailing list > Bioconductor at r-project.org > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor > -- Eloi Mercier Bioinformatics PhD Student, UBC Paul Pavlidis Lab 2185 East Mall University of British Columbia Vancouver BC V6T1Z4
ADD COMMENT

Login before adding your answer.

Traffic: 484 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6