I have a shapefile (polygon) that I only want to plot part of, so using ggplot's geom_path I limit the visible path with xlim and ylim. Shapefile is available here (2.5 MB).
library(rgdal)
library(ggplot2)
coast <- readOGR(dsn=".", layer="coast-rgdal")
coast.df <- fortify(coast, region="STATE_NAME")
p <- ggplot(coast.df, aes(x=long, y=lat, group=group)) +
geom_path(colour="black", size=1/4) +
xlim(146, 148) + ylim(-39.25, -37.5) + coord_fixed()
p
Which looks like this:
What I would like to have is something like this with a closed path (done with gimp):
Can I do that with ggplot commands? Or something else in R?
For reference, the full polygon looks like: