[R-sig-Geo] odd behaviour of llgridlines() regarding axes labels
Agustin Lobo
alobolistas at gmail.com
Fri Feb 26 14:15:12 CET 2016
Thanks, that fixes it.
I will try graticules as well.
Agus
On Fri, Feb 26, 2016 at 12:45 PM, Michael Sumner <mdsumner at gmail.com> wrote:
> 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:
>
>> I see an odd behaviour of llgridlines() regarding axes labels:
>>
>> require(rgdal)
>> require(raster)
>> a <- extent(c(-90,-81.5625,8.407168,16.63619))
>> a <- as(a, 'SpatialPolygons')
>> projection(a) <- "+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84
>> +towgs84=0,0,0"
>>
>> No axis labels on x axis:
>> plot(a,axes=FALSE)
>> llgridlines(a, plotLines=TRUE, plotLabels=TRUE)
>>
>> #same with:
>> plot(a,axes=FALSE,mar=c(4, 3, 2, 3)+0.1)
>> llgridlines(a, plotLines=TRUE, plotLabels=TRUE)
>>
>> #and 2 vertical axes with:
>> plot(a,axes=TRUE)
>> llgridlines(a, plotLines=TRUE, plotLabels=TRUE)
>>
>> Any hint?
>>
>> Thanks
>> Agus
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> R-sig-Geo at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
> --
> Dr. Michael Sumner
> Software and Database Engineer
> Australian Antarctic Division
> 203 Channel Highway
> Kingston Tasmania 7050 Australia
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
More information about the R-sig-Geo
mailing list