Skip to content

red-black-green color palette?

4 messages · Jake Michaelson, Romain Francois, James W. MacDonald +1 more

#
I'm working on some heatmaps, and the person I'm working with would 
prefer a red-black-green color palette (red denoting gene induction and 
green denoting gene repression).  Does such a palette exist already?  
If not, is there an easy way to create one?

Thanks,

Jake
#
Le 03.08.2005 18:23, Jake Michaelson a ??crit :
greenred in gplots is what you are looking for.

Cheers,

Romain
#
Jake Michaelson wrote:
See ?maPalette in the marray package of Bioconductor.

HTH,

Jim

  
    
#
"Jake Michaelson" <jjmichael at comcast.net> wrote in message
news:cbc7a1be7e3c68c0ccac507be8d3e7d8 at comcast.net...
Here are four ways:

showpanel <- function(Colors)
{
  image(matrix(1:length(Colors), ncol=1), col=Colors, xaxt="n", yaxt="n" )
}

oldpar <- par(mfrow=c(4,2))

# Method 1 (colorRampPalette was new in R 2.1.0) in grDevices
# Same as function with same name in dichromat package?
showpanel(colorRampPalette( c("green", "black", "red"), space="rgb")(32))
showpanel(colorRampPalette( c("green", "black", "red"), space="rgb")(64))

# Method 2
library(gplots)
showpanel(greenred(32))
showpanel(redgreen(64))

# Method 3
library(geneplotter)
showpanel(greenred.colors(32))
showpanel(greenred.colors(64))

# Method 4
library("marray")
pal <- maPalette(low="green", high="red",mid="black")
maColorBar(seq(-2,2, 0.2), col=pal, horizontal=TRUE, k=0)
maColorBar(seq(-2,2, 0.1), col=pal, horizontal=TRUE, k=0)


efg
--
Earl F. Glynn
Scientific Programmer
Stowers Institute for Medical Research