| theme_map | R Documentation |
A clean theme that is good for displaying maps from
geom_map().
theme_map(base_size = 9, base_family = "")
base_size |
base font size, given in pts. |
base_family |
base font family |
A ggplot2 theme object (class theme).
library("ggplot2")
if (requireNamespace("maps", quietly = TRUE) && requireNamespace("mapproj", quietly = TRUE)) {
us <- map_data("state")
gg <- ggplot(us, aes(x = long, y = lat, group = group)) +
geom_polygon(fill = "white", color = "black", linewidth = 0.25) +
coord_map("albers", lat0 = 39, lat1 = 45) +
theme_map()
gg
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.