Skip to content

heatmap

4 messages · Andrea Zangrando, Romain Francois, vincent@7d4.com +1 more

#
Hi,
i created a graph with heatmap(sma) function:

heatmap(dataHeat(x))

and I wish to change the gradation of colors from blue to red, how could 
i do?
Using "heatmap(dataHeat(x), col=c(2,4))" i will use only 2 colors 
without gradation.

Ty so much
Andrea
#
Le 03.10.2005 14:24, Andrea Zangrando a ??crit :
Hello,

Check bluered() in the gplots package.

Romain
#
Andrea Zangrando a ??crit :
Hello,
here's how I build such a palette.

a = 15;
palwhiteblue = rgb(a:0, a:0, a, max=a);
palredwhite  = rgb(a, 0:a, 0:a, max=a);
palwhite     = rep(rgb(1,1,1), 8);
palRWB       = c(palredwhite, palwhite, palwhiteblue);

of course, to adapt to your own uses.
hih
Vincent
#
On Mon, 3 Oct 2005, Romain Francois wrote:

            
Or roll your own in base:
function (n) 
{
    x <- ramp(seq(0, 1, length = n))
    rgb(x[, 1], x[, 2], x[, 3], max = 255)
}
<environment: 0x9a5792c>
[1] "#0000FF" "#1200EC" "#2400DA" "#3600C8" "#4800B6" "#5B00A3" "#6D0091"
 [8] "#7F007F" "#91006D" "#A3005B" "#B60048" "#C80036" "#DA0024" "#EC0012"
[15] "#FF0000"