Dear all, Lattice provides automatic coloring for subgroups on each panel by the simple use of a groups statement. For an application I want to change these colors to a predifined set. This works well using a panel function in stead of the default as long as there are only points in the graphs. When I set type="b" things get messed up. Any idea why? I include sample code for illustration below.
Thanks for your ideas. Geert dataset <- data.frame ( time = rep(1:5,times=9), genotype = factor(rep(rep (c("A","B","C"),each=5),times=3 )), location= factor(rep (paste("LOC",1:3),each=15)), color = rep (rep (c("red","green","blue"),each=5),times=3 ), result = rnorm (45)) library(lattice) xyplot( result ~ time | location, data=dataset,groups=genotype,pch=19, type="b") xyplot( result ~ time | location, data=dataset,groups=genotype, fill.color = dataset$color, panel = function(x, y,fill.color,...,subscripts) { fill = fill.color [subscripts] panel.xyplot(x, y,pch=19, col=fill)} ) xyplot( result ~ time | location, data=dataset,groups=genotype, fill.color = dataset$color, panel = function(x, y,fill.color,...,subscripts) { fill = fill.color [subscripts] panel.xyplot(x, y,pch=19, col=fill, type ="b")} ) ________________________________________________________________________ The information contained in this e-mail is for the excl...{{dropped:14}} ______________________________________________ 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.