papaja (version 0.1.2)

theme_apa: APA-style ggplot2 Theme

Description

ggplot2 theme with a white panel background, no grid lines, large axis and legend titles, and increased text padding for better readability.

Usage

theme_apa(base_size = 12, base_family = "", box = FALSE)

Value

Object of class theme and gg, see ggplot2::theme().

Arguments

base_size

Numeric. Base font size; other font sizes and margins are adjusted relative to this.

base_family

Character. Base font family.

box

Logical. Indicates whether to draw a black panel border.

See Also

Examples

Run this code
 # \donttest{
   # Copied from ?ggtheme
   mtcars2 <- within(mtcars, {
   vs <- factor(vs, labels = c("V-shaped", "Straight"))
   am <- factor(am, labels = c("Automatic", "Manual"))
   cyl  <- factor(cyl)
   gear <- factor(gear)
   })

   library("ggplot2")
   p1 <- ggplot(mtcars2) +
     geom_point(aes(x = wt, y = mpg, colour = gear)) +
     labs(
       title = "Fuel economy declines as weight increases",
       subtitle = "(1973-1974)",
       x = "Weight (1000 lbs)",
       y = "Fuel economy (mpg)",
       colour = "Gears"
     )

   p1
   p1 + theme_apa()
 # }

Run the code above in your browser using DataLab