Warning.... very novice question follows:
I am trying to plot a fairly regular distribution of several thousand (X,Y) points each associated with a value, let\'s cal
The "concept" you are missing is the at
argument to levelplot()
which defines the breakpoints between colour levels and/or contour lines. The default is pretty(z)
which results in only a few levels. You can set at
to be a sequence covering the range of values you want.
library(latticeExtra)
dat <- data.frame(x = rnorm(1000), y = rnorm(1000), z = rnorm(1000, mean = 1))
## for centering the colour key around zero
maxz <- max(abs(dat$z))
levelplot(z ~ x * y, dat, at = seq(-maxz, maxz, length = 100),
panel = panel.levelplot.points, par.settings = custom.theme.2())