Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

inset_raster

Create a (ggplot2) raster layer


Description

This is a special version of ggplot2::annotation_raster for use with ggmap. (It simply removes the requirement for cartesian coordinates.) The only difference between inset_raster and inset_ggmap is their arguments. inset_ggmap is simply a wrapper of inset_raster with xmin, ..., ymax arguments equal to the map's bounding box.

Usage

inset_raster(raster, xmin, xmax, ymin, ymax, interpolate = TRUE)

inset_ggmap(ggmap)

Arguments

raster

raster object 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

interpolate

interpolate the raster? (i.e. antialiasing)

ggmap

a ggmap object, see get_map

Examples

# see ?bb2bbox

ggmap

Spatial Visualization with ggplot2

v3.0.0
GPL-2
Authors
David Kahle [aut, cre] (<https://orcid.org/0000-0002-9999-1558>), Hadley Wickham [aut] (<https://orcid.org/0000-0003-4757-117X>), Scott Jackson [aut], Mikko Korpela [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.