theme_map: Clean theme for maps

View source: R/theme-map.R

theme_mapR Documentation

Clean theme for maps

Description

A clean theme that is good for displaying maps from geom_map().

Usage

theme_map(base_size = 9, base_family = "")

Arguments

base_size

base font size, given in pts.

base_family

base font family

Value

A ggplot2 theme object (class theme).

Examples

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
}

ggthemes documentation built on Oct. 4, 2026, 1:06 a.m.