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

Dimitri Liakhovitski dimitri.liakhovitski at gmail.com
Tue Oct 5 17:16:47 CEST 2010


Barry - thanks a lot, it's great. Now, the gridlines "stick" to the tick marks!
Just wondering why the product of "grid" does not.
D.

On Tue, Oct 5, 2010 at 11:07 AM, Barry Rowlingson
<b.rowlingson at lancaster.ac.uk> wrote:
> 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
>



-- 
Dimitri Liakhovitski
Ninah Consulting
www.ninah.com



More information about the R-help mailing list