This function provides a custom theme for ggplot2 following the guidelines set by the American Marketing Association.

ama_theme(
  base_size = 16,
  base_family = "sans",
  title_size = ggplot2::rel(1.2),
  axis_title_size = ggplot2::rel(1.2),
  legend_title_size = ggplot2::rel(0.6),
  legend_text_size = ggplot2::rel(0.6),
  axis_text_size = ggplot2::rel(1),
  ...
)

Arguments

base_size

Base font size.

base_family

Font family. Use "sans" for Arial and "serif" for Times New Roman.

title_size

Title font size as a relative value.

axis_title_size

Axis title font size as a relative value.

legend_title_size

Legend title font size as a relative value.

legend_text_size

Legend text font size as a relative value.

axis_text_size

Axis text font size as a relative value.

...

Additional theme elements to be passed to ggplot2::theme().

Value

A ggplot2 theme.

Examples

if (FALSE) {
library(ggplot2)
# Using Arial font
ggplot(mtcars, aes(mpg, wt)) + geom_point() + ama_theme()
# Using Times New Roman font
ggplot(mtcars, aes(mpg, wt)) + geom_point() + ama_theme(base_family = "serif")
}