The symbol fills the color in the grid with auto.key

I make a graph using xyplot in lattice (R 15.2, lattice 0.20-13), in which I have several groups that I would like to distinguish by marker shape. I need to use a down triangle, which is only available as a hollow character ( pch=25 ), unlike a triangle, which is available as a filled ( pch=17 ) or hollow ( pch=24 ) character. I can specify both the outline color and the fill color for these characters in par.settings(superpose.line()) , but when I draw auto.key , the fill does not fill. Is there a way for auto.key match the symbols of the chart?

This is an example of what I am describing:

 data <- data.frame(x_var = rep(1:10, 2), y_var = rnorm(20), group=rep(c(1,2),each=10)) xyplot(y_var ~ x_var, groups=group, data=data, par.settings=list(superpose.symbol=list(col=c("red", "blue"), fill=c("red", "blue"), pch=c(24, 25), cex=2)), auto.key=list(space="right")) 
+4
source share
2 answers

Today I tried both your version and the version available today in CRAN (0.20-14). Both of them cannot fill in the legend symbols. However, your code works correctly with version 0.20-10 . Therefore, I'm afraid you found a mistake. Could you send an email to the maintainer?

UPDATE: this error is fixed in version 0.20-15.

+2
source

Try: par.settings = list (strip.background = list (col = "red"), superpose.symbol = list (pch = c (17,19,22), col = c ("red", "green", "blue")))

0
source

All Articles