Skip to content
Prev 66719 / 398506 Next

help with plotting a grid on levelplot

On Tuesday 29 March 2005 19:16, Jeff D. Hamann wrote:
You are not allowed to use base graphics functions (like grid) in 
lattice panel functions. You have to use grid (the package, not the 
function) functions. There are many such functions defined in lattice 
which can be useful, in this case 'panel.grid' or more likely 
'panel.abline'.

I'm not sure I understand your attempted usage though; you seem to 
assign the value of grid() (which would be NULL) to a variable called 
panel.last. This does not have any possible use that I can see.
Unless you understand very well what you are doing, I would stay away 
from micro-managing calls to complicated panel functions like 
panel.levelplot. In particular, I would suggest something like

panel = function(...) {
  panel.levelplot(...)
  panel.abline(h=<whatever>, v=<whatever>)
}