I'm trying to plot a grid over a levelplot
print( levelplot( var1.pred~x+y,
data=saw.pred,
aspect=mapasp(saw.pred),
col.regions=terrain.colors(80),
main=main) )
using the data...
x y var1.pred var1.var sort
1 5 5 3.3761200 256.3363 saw
2 15 5 3.3884142 499.5695 saw
3 25 5 3.5394769 362.5490 saw
4 35 5 3.6386983 439.3200 saw
5 45 5 3.1866799 458.5570 saw
6 55 5 2.8838555 331.2363 saw
..blah...blah...blah...
15 145 5 0.8705088 256.3363 saw
16 5 15 3.1183053 455.3765 saw
17 15 15 3.2780465 443.1954 saw
18 25 15 3.7146268 435.1166 saw
which looks just fine. I know want to plot a grid such that the cells
are grouped into 5x5 cells (or some other grid spacing) over the
levelplot for a demonstration and I'm getting stuck when trying to
modify my levelplot() call above to include the extra calls to
panel.levelplot...
I've gotten this far,
## plot the results (10mx10m plot that's 150m x 200m)
main=expression( paste( widehat(V)[saw], ", in ", m^3, ha^{-1} ) )
print( levelplot( var1.pred~x+y,
data=saw.pred,
aspect=mapasp(saw.pred),
main=main,
panel = function(x,y,z=var1.pred )
{
panel.levelplot( x=x, y=y, z=z,
subscripts=1:nrow(saw.pred),
col.regions=terrain.colors(80),
)
panel.last=grid( 15, 20, lwd=2, lty="solid",
col="black" )