I reproduce the number 5.6 in the book "Lattice" by Dipayan Sarkar, although it uses one panel. Right now I'm struggling to get the title over the color bar ...
Here is some reproducible code.
x <- seq(1,20,.1)
y <- rnorm(length(x))
z <- seq(1,200,length.out=length(x))
cols <- rainbow(100)[cut(z,100,label=F)]
xyplot(y~x, aspect="iso", type=c("p","g"), col=1, pch=21,fill=cols,
legend=list(right=
list(fun = draw.colorkey,
args=list(key=list(col = rainbow,at = do.breaks(range(z),100))))),
panel=function(x,y,...){
panel.xyplot(x,y,...)
}
)
Any clue? Thank,
AND
source
share