[BioC] graph for microarray data

Wolfgang Huber huber at ebi.ac.uk
Mon Sep 15 19:37:41 CEST 2008


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



More information about the Bioconductor mailing list