TITLE: Making inset maps for publication
DATE: 2019-02-20
AUTHOR: John L. Godlee
====================================================================
In scientific publications, often there is a map to describe the
study location. For example in Burton et al. (2013), which is the
first publication I found with an inset map by searching for the key
word “inset map”.
{IMAGE}
I wanted to be able to make these maps directly in R, rather than
manually exporting each map image and overlaying them in PowerPoint
or Photoshop. The maps I make are in {ggplot2}, so the examples here
all use ggplot2. The example involves making a map of Angola and
adding some points of key cities, then adding an inset map showing
the location of Angola in the world.
First, load some packages:
library(ggplot2)
library(rworldmap)
Then create fortified polygons by grabbing country data from
{rworldmap}, using the getMap() function:
world <- getMap(resolution = "low")
world_f <- fortify(world)
annotation_custom() allows you to set the x and y location of the
grob, using the coordinate system on the base plot, which in this
case is decimal latitude and longitude.