layer_spatial.bbox {ggspatial} | R Documentation |
Add a bounding box to a map
Description
To include a bounding box without drawing it, use shadow_spatial()
on the
original object.
Usage
## S3 method for class 'bbox'
layer_spatial(data, mapping = aes(), ..., detail = 30)
## S3 method for class 'bbox'
annotation_spatial(data, mapping = aes(), ..., detail = 30)
## S3 method for class 'bbox'
shadow_spatial(data, ..., detail = 30)
Arguments
data |
A bounding box generated by |
mapping |
A mapping, created using aes. |
... |
Passed to geom_sf |
detail |
Passed to |
Examples
library(ggplot2)
load_longlake_data(which = c("longlake_waterdf", "longlake_depthdf"))
ggplot() +
layer_spatial(sf::st_bbox(longlake_waterdf)) +
layer_spatial(longlake_depthdf)
# use shadow_spatial() to include the geographic area of an object
# without drawing it
ggplot() +
shadow_spatial(longlake_waterdf) +
layer_spatial(longlake_depthdf)
[Package ggspatial version 1.1.9 Index]