theme_trakt: Theme Matching trakt.tv (Dark Knight Mode)

View source: R/theme_trakt.R

theme_traktR Documentation

Theme Matching trakt.tv (Dark Knight Mode)

Description

Theme Matching trakt.tv (Dark Knight Mode)

Usage

theme_trakt(
  title.size = 16,
  text.size = 14,
  legend.position = "top",
  show.axis = FALSE,
  show.grid = TRUE,
  plot.margin = c(0.7, 0.7, 0.7, 0.7),
  plot.title.position = "plot",
  font.base = font_lato,
  font.title = font_lato_semibold,
  font.subtitle = font_lato,
  font.caption = font_lato_light
)

Arguments

title.size

title element size in pts.

text.size

text element size in pts.

legend.position

either one of "none", "left", "right", "bottom", "top".

show.axis

boolean or "x", "y"; should axis be drawn? Which?.

show.grid

boolean; should grid lines be drawn?.

plot.margin

margin around entire plot (unit with the sizes of the top, right, bottom, and left margins).

plot.title.position

Defaults to "plot" for left-aligned title.

font.base, font.title, font.caption, font.subtitle

Default font family is "Lato", but trakt.tv uses "Proxima Nova Semibold" - which is a neat font, but I can neither afford nor supply it with this package.

Details

Using this function changes the default color for many geoms via ggplot2::update_geom_defaults, which, unfortunately, is rather complicated to undo. One easy but blunt way is to restart your R session.

Note

See sysfonts::font_add_google and the showtext package to add the Lato font.

Examples

## Not run: 
library(ggplot2)
p <- ggplot(iris, aes(x = Sepal.Width)) +
  geom_histogram(binwidth = .25) +
  labs(
    title = "Yet another iris plot",
    subtitle = "Using theme_trakt",
    caption = "Oh hi there, didn't see you walk in"
  )

p + theme_trakt()

p <- ggplot(mtcars, aes(x = wt, y = mpg)) +
  geom_line(stat = "smooth", method = lm, formula = y ~ x) +
  geom_point(size = 2) +
  labs(
    title = "The ggplot we've all seen",
    subtitle = "Using theme_trakt",
    x = "Weight", y = "Miles per Gallon",
    color = "Gears", caption = "I am also here!"
  )
p + theme_trakt()

## End(Not run)

tadaadata/tadaathemes documentation built on Feb. 3, 2024, 7:43 a.m.