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
heatmap
4 messages · Andrea Zangrando, Romain Francois, vincent@7d4.com +1 more
Le 03.10.2005 14:24, Andrea Zangrando a ??crit :
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
Hello, Check bluered() in the gplots package. Romain
visit the R Graph Gallery : http://addictedtor.free.fr/graphiques ~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~ ~~~~~~ Romain FRANCOIS - http://addictedtor.free.fr ~~~~~~ ~~~~ Etudiant ISUP - CS3 - Industrie et Services ~~~~ ~~ http://www.isup.cicrp.jussieu.fr/ ~~ ~~~~ Stagiaire INRIA Futurs - Equipe SELECT ~~~~ ~~~~~~ http://www.inria.fr/recherche/equipes/select.fr.html ~~~~~~ ~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~
Andrea Zangrando a ??crit :
... and I wish to change the gradation of colors from blue to red, how could i do?
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:
Le 03.10.2005 14:24, Andrea Zangrando a ??crit :
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
Hello, Check bluered() in the gplots package.
Or roll your own in base:
myBlRd <- colorRampPalette(c("blue", "red"))
myBlRd
function (n)
{
x <- ramp(seq(0, 1, length = n))
rgb(x[, 1], x[, 2], x[, 3], max = 255)
}
<environment: 0x9a5792c>
myBlRd(15)
[1] "#0000FF" "#1200EC" "#2400DA" "#3600C8" "#4800B6" "#5B00A3" "#6D0091" [8] "#7F007F" "#91006D" "#A3005B" "#B60048" "#C80036" "#DA0024" "#EC0012" [15] "#FF0000"
Romain
Roger Bivand Economic Geography Section, Department of Economics, Norwegian School of Economics and Business Administration, Helleveien 30, N-5045 Bergen, Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43 e-mail: Roger.Bivand at nhh.no