I have the following data:
x=strptime(20010101:20010110)
y=1:10
z=data.frame(x,y)
So my data is this:
x y
1 2
As the ?grid help file says, "if more fine tuning is required, [you can] use abline(h = ., v = .) directly". It's a little bit more work, but not much, and would be easy enough to wrap up in a function if you want to use it often.
Here's one way to do it:
plot(x,y)
abline(v = pretty(extendrange(z$x)),
h = pretty(extendrange(z$y)),
col = 'lightgrey', lty = "dotted")
points(x,y, pch=16)
