-----Original Message----- From: Duncan Murdoch [mailto:[EMAIL PROTECTED] Sent: ned 2004-10-17 15:34 To: Gorjanc Gregor Cc: [EMAIL PROTECTED] Subject: Re: [R] Plotcorr: colour the ellipses to emphasize the differences On Sun, 17 Oct 2004 02:51:58 +0200, "Gorjanc Gregor" <[EMAIL PROTECTED]> wrote:
[removed old stuff] >>I would also like to know if it is possible to use some other scale of >> colors instead of cm.colors, rainbow, heat.colors, terrain.colors, >> topo.colors. I would like to have positive correlations in blue and >> nagative ones in red spectrum of colors. Is it possible? > The source of cm.colors is visible (just type "cm.colors" and it will > be printed). You could write your own function to change the scale to > blue through red instead of cyan through magenta by changing a few > constants in that function. Thanks, that helped me to do what I wanted. Thanks. Bellow is the code. cm.colors <- function (n) { # from red from=0 # to blue to=8/12 if ((n <- as.integer(n[1])) > 0) { even.n <- n%%2 == 0 k <- n%/%2 l1 <- k + 1 - even.n l2 <- n - k + even.n c(if (l1 > 0) hsv(h = from, s = seq(0.5, ifelse(even.n, 0.5/k, 0), length = l1), v = 1), if (l2 > 1) hsv(h = to, s = seq(0, 0.5, length = l2)[-1], v = 1)) } else character(0) } > I think it would be useful to have a general function that did what > cm.colors does but for other paths through colour space, but I've > never written one (or done a thorough search to see if someone else > has.) I agree with this! With regards, Gregor GORJANC ______________________________________________ [EMAIL PROTECTED] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html