ggplot2 maps with insets

UPDATE: changed data source so that the entire example can be run by anyone on their own machine. Also, per Joachim’s suggestion, I put a box around the blown up area of the map. In addition, rgeos and maptools removed, not needed. Here’s a quick demo of creating a map with an inset within it using ggplot. The inset is achieved using the gridExtra package. Install libraries install.packages(c("ggplot2", "maps", "grid", "gridExtra")) library("ggplot2") library("maps") library("grid") library("gridExtra") Create a data frame dat <- data....

August 22, 2012 · 3 min · Scott Chamberlain