[R-sig-Geo] Problems with mapmisc::insetMap()

Agustin Lobo alobolistas at gmail.com
Fri Feb 26 11:02:49 CET 2016


Much better now!

nica <- getData("GADM", country="NIC", level=0)
nicabg <- openmap(nica, path="landscape")
map.new(nicabg,1,mar=c(2, 2, 2, 0) + 0.1)
plot(nicabg,axes=TRUE)
plot(nica,add=TRUE)
loc <- insetMap(nica,pos=c(-89.9,8.5), width=0.3, col=NA, lty=0,pch=".")
points(loc)

Just 2 questions:
1. In the example you provide, the resulting mark is too thick. I've
made a thinner version with pch=".", but
it would nice having the option of just drawing the central point and
not the window.
2. Is there a way to calculate the size of the plotting window so that
there is no wasted white space
between the map and the axes? I can do this by hand, but then cannot
read the size.

Thanks

On Thu, Feb 25, 2016 at 6:46 PM, Patrick Brown
<patrick.brown at utoronto.ca> wrote:
> Hello all, my first post here!
>
>
> mapmisc (1.4.8 from r-forge) now allows
>
>
> require(rgdal)
> require(raster)
> require(mapmisc)
> nica <- getData("GADM", country="NIC", level=0)
> nicabg <- openmap(nica, path="landscape")
> map.new(nicabg, 0.7,mar=c(2, 2, 2, 0) + 0.1)
> plot(nicabg,axes=TRUE)
> plot(nica,add=TRUE)
> loc = insetMap(nica,pos=c(-85,12), width=0.3, col=NA, lty=0)
> points(loc)
>
> p
>
> _______________________________________________
> 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