save_ggmap | R Documentation |
Wrapper around ggsave()
to save maps produced with ggplot with appropriate aspect ratio.
save_ggmap(filename, plot = last_plot(), width = NA, height = NA, ...)
filename |
File name to create on disk. |
plot |
Plot to save, defaults to last plot displayed. |
width, height |
Plot size in units ("in", "cm", or "mm"). If not supplied, uses the size of current graphics device. |
... |
Other arguments passed on to |
## Not run: world <- rnaturalearth::ne_countries(returnclass = "sf") ggplot() + geom_sf(data = world) + coord_sf(expand = FALSE) + theme_void() save_ggmap("world.svg", width = 8) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.