[R] is there a way to avoid "traveling" grid?

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Tue Oct 5 17:07:12 CEST 2010


On Tue, Oct 5, 2010 at 3:37 PM, Dimitri Liakhovitski
<dimitri.liakhovitski at gmail.com> wrote:
> my.data$date

I wouldn't use grid - it suggests you try abline, so something like:

 > abline(v=my.data$date,lty=2)

 - to put vertical lines at your data points. For the horizontal grid
lines, we can just use the axis tick marks:

 > axTicks(2)
 [1] -5  0  5 10 15 20

 thus:

 > abline(h=axTicks(2), lty=2)

adjust lty and col options to suit

Barry


-- 
blog: http://geospaced.blogspot.com/
web: http://www.maths.lancs.ac.uk/~rowlings
web: http://www.rowlingson.com/
twitter: http://twitter.com/geospacedman
pics: http://www.flickr.com/photos/spacedman



More information about the R-help mailing list