我想在ellipse colors
内更改width
和lattice xyplot
。
这是一个例子:
library(lattice)
xyplot(Sepal.Length ~ Petal.Length, groups=Species,
data = iris, scales = "free",
par.settings = list(superpose.symbol = list(pch = 18, cex = 0.9,col = c("green", "orange","brown"),superpose.line = list(lwd=2))),
panel = function(x, y, ...) {
panel.xyplot(x, y, ...)
panel.ellipse(x, y, ...)
},
auto.key = list(x = .1, y = .8, corner = c(0, 0)))
答案 0 :(得分:2)
正如user20650
的评论中所述,您可以向panel.ellipse
功能添加其他选项。在这种情况下,您需要添加col
和lwd
选项。
library(lattice)
library(latticeExtra) # you forgot to mention this package in question
xyplot(Sepal.Length ~ Petal.Length, groups = Species, data = iris,
scales = "free", auto.key = list(x = 0.1, y = 0.8, corner = c(0, 0)),
par.settings = list(superpose.symbol = list(pch = 18, cex = 0.9,
col = c("green", "orange","brown"),
superpose.line = list(lwd=2))),
panel = function(x, y, ...) {
panel.xyplot(x, y, ...)
panel.ellipse(x, y, col = c("green", "orange", "brown"),
lwd = c(5, 5, 5), ...)
}
)