theme_trakt | R Documentation |
Theme Matching trakt.tv (Dark Knight Mode)
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
)
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 |
font.base, font.title, font.caption, font.subtitle |
Default font
family is |
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.
See sysfonts::font_add_google
and the showtext
package to add
the Lato font.
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.