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"))
source share