inset: Add ggplot2 insets to a map

Description Usage Arguments Details Note


This is identical to ggplot2::annotation_custom for use with ggmap


inset(grob, xmin = -Inf, xmax = Inf, ymin = -Inf, ymax = Inf)



grob to display

xmin, xmax

x location (in data coordinates) giving horizontal location of raster

ymin, ymax

y location (in data coordinates) giving vertical location of raster


Most useful for adding tables, inset plots, and other grid-based decorations


annotation_custom expects the grob to fill the entire viewport defined by xmin, xmax, ymin, ymax. Grobs with a different (absolute) size will be center-justified in that region. Inf values can be used to fill the full plot panel

Search within the ggmap package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.