View source: R/sm_coordinates.R
waiver | R Documentation |
Set coordinate limits for a ggplot map based on a sf object or a bbox object, having an option for expanding the limits (expansion)
waiver()
data |
The dataframe containing the spatial information for the box limits. |
bbox |
An st_bbox objetc as a named vector for getting the box limits |
expansion |
a vector trbl for expandin any dimension over the initial limits |
projected |
logical, if T the original source (data or bbox) is in a projected CRS |
The coordinates for an accurate plot
## Not run:
librar(sf)
sf_utam %>%
ggplot() +
geom_sf(data = bogota_unido, fill = "#EBECF2") +
geom_sf(aes(fill = as.factor(ESTRATOPre)), alpha = 0.6) +
scale_fill_brewer("Estrato", palette = "YlGnBu") +
theme_void(base_family = "Franklin Gothic Book") +
theme(plot.background = element_rect(fill = "#EBECF2", color = NA),
plot.margin = margin(r = 10),
text = element_text(size = 10)) +
coord_sf_santi(bbox = a, expansion = space(r = 0.5))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.