Add a map figure.

fig_map(g, ..., inherit_asp = TRUE, sync = TRUE, map = get_world_map())

Arguments

g

An object of class g2r or g2Proxy as returned by g2() or g2_proxy().

...

Options to pass to the figure, including asp(), and adjust(), active(), selected(), and config(), other key value pairs of are passed to style.

inherit_asp

Whether to inherit the aspects paseed to g2() initialisation function.

sync

Whether to sync the axis data (align) with that used in other figures, set to FALSE to not sync or set to a character string to use as name of sync group.

map

Name of map to pass to the region argument of the get_map_data() function, or map object as returned by get_world_map(), get_gadm_data(), or get_map_data(), or a SpatialPolygonsDataFrame as returned by raster::getData(), or a geo_list as obtained from geojsonio::geojson_list(), or MULTIPOLYGON of the classsf as obtained from reading shapefiles.

Examples

g2() %>%
  fig_map(stroke = "#fff", fill = "gray") %>%
  axis_hide()