graph for microarray data
1
0
Entering edit mode
Tim Smith ★ 1.1k
@tim-smith-1532
Last seen 9.6 years ago
Hi, I was just trying to get a heatmap of sorts with data that has only 3 values (-1,0,1). For example: ---------------------------------- library(stats) eg <- matrix(-1:1,10,10) rownames(eg) <- LETTERS[1:10] colnames(eg) <- c(1:10) heatmap(eg) ------------------------------- However, the heatmap that I get has 5 colors. What do I need to do so that only 3 colors (each representing one of 1,0,-1) are displayed? thanks! [[alternative HTML version deleted]]
• 589 views
ADD COMMENT
0
Entering edit mode
@james-w-macdonald-5106
Last seen 11 hours ago
United States
Hi Tim, Tim Smith wrote: > Hi, > > I was just trying to get a heatmap of sorts with data that has only 3 values (-1,0,1). For example: > > ---------------------------------- > library(stats) > eg <- matrix(-1:1,10,10) > rownames(eg) <- LETTERS[1:10] > colnames(eg) <- c(1:10) > heatmap(eg) > > ------------------------------- > > However, the heatmap that I get has 5 colors. What do I need to do so that only 3 colors (each representing one of 1,0,-1) are displayed? Specify the colors directly: heatmap(eg, col = c("red","green","black")) Best, Jim > > thanks! > > > > [[alternative HTML version deleted]] > > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor -- James W. MacDonald, M.S. Biostatistician Hildebrandt Lab 8220D MSRB III 1150 W. Medical Center Drive Ann Arbor MI 48109-0646 734-936-8662
ADD COMMENT
0
Entering edit mode
James W. MacDonald wrote: > Hi Tim, > > Tim Smith wrote: >> Hi, >> >> I was just trying to get a heatmap of sorts with data that has only 3 >> values (-1,0,1). For example: >> >> ---------------------------------- >> library(stats) >> eg <- matrix(-1:1,10,10) >> rownames(eg) <- LETTERS[1:10] >> colnames(eg) <- c(1:10) >> heatmap(eg) >> >> ------------------------------- >> >> However, the heatmap that I get has 5 colors. What do I need to do so >> that only 3 colors (each representing one of 1,0,-1) are displayed? > > Specify the colors directly: > > heatmap(eg, col = c("red","green","black")) > > Best, > Also, after you've had a look at the manual page section for the "scale" argument of "heatmap", you may choose to use heatmap(eg, scale="none", col = c("blue","white","red")) Best wishes Wolfgang ---------------------------------------------------- Wolfgang Huber, EMBL-EBI, http://www.ebi.ac.uk/huber
ADD REPLY

Login before adding your answer.

Traffic: 661 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