Skip to content
generated from dracula/template

πŸ§›πŸ»β€β™‚οΈ Dark theme for R

License

Notifications You must be signed in to change notification settings

dracula/dRacula

Folders and files

NameName
Last commit message
Last commit date

Latest commit

62c369c Β· Mar 6, 2025
Jul 17, 2024
Feb 25, 2025
Jul 7, 2024
Mar 5, 2025
Mar 5, 2025
Feb 25, 2025
Mar 6, 2025
Mar 5, 2025
Mar 6, 2025
Nov 26, 2023
Jul 8, 2024
Feb 25, 2025
Jul 7, 2024
Jul 7, 2024
Feb 25, 2025
Feb 25, 2025
Feb 25, 2025
Jul 7, 2024
Dec 12, 2023

Repository files navigation

{dRacula} | Dracula Theme for R Dracula logo in an R hex sticker

R-CMD-check

All things Dracula themed for R

Install

All instructions can be found at draculatheme.com/R.

devtools::install_github("dracula/dRacula")

or

remotes::install_github("dracula/dRacula")

Examples

Add a Dracula-themed _brand.yaml to your project:

library(dRacula)
dracula_brand()

Dracula-branded Shiny App

Apply the Dracula theme and color scale to a linear regression plot:

library(dplyr)
library(ggplot2)
library(dRacula)

lm <- lm(mpg ~ wt, data = mtcars)

ggplot(mtcars %>% mutate(resid = abs(resid(lm)), fitted = fitted(lm))) +
  geom_line(aes(wt, fitted)) +
  geom_point(aes(wt, mpg, color = resid)) +
  scale_color_dracula(discrete = FALSE) +
  theme_dracula() +
  ggtitle("mtcars: MPG by Weight") +
  labs(x = "Weight", y = "MPG", color = "Residuals")

Apply the Dracula palette and theme to proportional stacked area chart:

library(dplyr)
library(ggplot2)
library(dRacula)

set.seed(1)
time <- rep(seq(1, 7), each = 5)
value <- runif(35, 10, 100)
group <- rep(LETTERS[1:5], times = 7)

data <- data.frame(time, value, group) %>%
  group_by(time, group) %>%
  summarise(n = sum(value), .groups = "drop") %>%
  mutate(percentage = n / sum(n))

ggplot(data, aes(x = time, y = percentage, fill = group)) +
  geom_area(alpha = 0.7, color = "black", linewidth = 0.4) +
  scale_fill_dracula(discrete = TRUE) +
  labs(
    title = "Proportional Stacked Area Chart",
    x = "Time",
    y = "Proportion",
    fill = "Group"
  ) +
  theme_dracula() +
  theme(legend.position = "bottom")

Team

This theme is maintained by the following person(s) and a bunch of awesome contributors.

Jordan Bradford
Jordan Bradford

Community

  • X - Best for getting updates about themes and new stuff.
  • GitHub - Best for asking questions and discussing issues.
  • Discord - Best for hanging out with the community.

Contributing

See CONTRIBUTING.md.

Acknowledgments

I’m indebted to the {viridis} and {wesanderson} R packages for inspiration and several plot examples.

License

MIT License