[BioC] heatmap.2 with different colour ranges

Mercier Eloi emercier at chibi.ubc.ca
Mon Feb 27 21:12:51 CET 2012


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



More information about the Bioconductor mailing list