Skip to content
Prev 24103 / 29559 Next

odd behaviour of llgridlines() regarding axes labels

1) is ok with xpd clipping turned off

op <- par(xpd = NA)
plot(a,axes=FALSE)
llgridlines(a, plotLines=TRUE, plotLabels=TRUE)
par(op)

2)  same
op <- par(xpd = NA)
plot(a,axes=FALSE,mar=c(4, 3, 2, 3)+0.1)
llgridlines(a, plotLines=TRUE, plotLabels=TRUE)
par(op)

3)  Consider using graticule package instead? You can control the extents
independently of the meridian/parallel lines (and optionally provided a
target projection. )

You have to give it the longs/lats you want, there's no automatic detection
from an object or plot - but for me that's the price of control over what I
get.

install.packages("graticule")
library(graticule)
plot(a,axes=TRUE)
library(graticule)
g <- graticule(seq(-90, -82, by = 2), seq(10, 16, by = 2), xlim =
par("usr")[1:2], ylim = par("usr")[3:4])
plot(g, add = TRUE, lty = 2)

Cheers, Mike.
On Fri, 26 Feb 2016 at 22:21 Agustin Lobo <alobolistas at gmail.com> wrote: