【发布时间】:2018-05-01 18:25:56
【问题描述】:
我想在xyplot 面板函数中分配两个 alpha 值:
points 与 alpha= 0.3 和 lines 与 alpha=1。
这是一个例子:
library(lattice)
library(sp)
data(meuse)
xyplot(elev~ copper,data=meuse,groups=factor(soil),grid = TRUE,scales=list(tck=c(1,0), x=list(cex=1.1), y=list(cex=1.1)),
auto.key = list(space = 'right',text=c("1", "2", "3")),
par.settings = list(superpose.symbol = list(pch =20, cex = 1,
col = c("#006837", "#41ab5d","#fd8d3c"))),
type = c("p", "smooth"),col.line =c("#006837", "#41ab5d","#fd8d3c"),lwd = 5,
panel = function(x, ...) {
panel.xyplot(x, ..., alpha = 0.3)
panel.lines(x, ..., alpha = 1)
})
【问题讨论】: