ggdark (version 0.2.1)

dark_mode: Activate dark mode on a 'ggplot2' theme

Description

Activate dark mode on a 'ggplot2' theme

Usage

dark_mode(.theme = theme_get(), verbose = TRUE,
  force_geom_invert = FALSE)

Arguments

.theme

ggplot2 theme object

verbose

print messages (default: TRUE)

force_geom_invert

Force the inversion of geom defaults for fill and color/colour (default: FALSE)

Value

dark version of theme

Examples

Run this code
# NOT RUN {
library(ggplot2)

p1 <- ggplot(iris, aes(Sepal.Width, Sepal.Length, color = Species)) +
  geom_point()

p1  # theme returned by theme_get()
p1 + dark_mode()  # activate dark mode on theme returned by theme_get()

p2 <- ggplot(iris, aes(Sepal.Width, Sepal.Length)) +
  geom_point() +
  facet_wrap(~ Species)

p2 + dark_mode(theme_minimal())  # activate dark mode on another theme

invert_geom_defaults()  # restore geom defaults to their original values
# }

Run the code above in your browser using DataLab