Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

theme_map

Create a theme for map plotting


Description

The theme created by this function is useful for plotting maps with cowplot default sizing.

Usage

theme_map(
  font_size = 14,
  font_family = "",
  line_size = 0.5,
  rel_small = 12/14,
  rel_tiny = 11/14,
  rel_large = 16/14
)

Arguments

font_size

Overall font size. Default is 14.

font_family

Base font family.

line_size

Line size for axis lines.

rel_small

Relative size of small text (e.g., axis tick labels)

rel_tiny

Relative size of tiny text (e.g., caption)

rel_large

Relative size of large text (e.g., title)

Value

The theme.

Examples

library(ggplot2)
library(maps)

usa_data = map_data("usa")
ggplot(usa_data, aes(long, lat, fill = region)) +
  geom_polygon() + theme_map()
ggplot(usa_data, aes(long, lat, fill = region)) +
  facet_wrap(~region, scales = "free") +
  geom_polygon() + theme_map()

cowplot

Streamlined Plot Theme and Plot Annotations for 'ggplot2'

v1.1.1
GPL-2
Authors
Claus O. Wilke [aut, cre] (<https://orcid.org/0000-0002-7470-9261>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.