Dear expeRts,

I would like to colorize the backgrounds of a pairs plot according to the 
respective panel number. Here is what I tried (without success):

count <- 0
mypanel <- function(x, y, ...){
    count <<- count+1
    bg. <- if(count %in% c(1,4,9,12)) "#FDFF65" else NA
    points(x, y, cex=0.5, bg=bg)
}

U <- matrix(runif(4*500), ncol=4)
pairs(U, panel=mypanel)

I also tried to set par(bg=bg.) before the call to points(), but that didn't 
work either. The only thing I found is that "bg=" can be used to fill certain 
plot symbols, but I would like to colorize the background of each panel, not 
the drawn circles.

Cheers,

Marius

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to