All things Dracula themed for R
All instructions can be found at draculatheme.com/R.
devtools::install_github("dracula/dRacula")
or
remotes::install_github("dracula/dRacula")
Add a Dracula-themed _brand.yaml
to your project:
library(dRacula)
dracula_brand()
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")
This theme is maintained by the following person(s) and a bunch of awesome contributors.
![]() |
---|
Jordan Bradford |
- 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.
See CONTRIBUTING.md
.
Iβm indebted to the {viridis}
and {wesanderson} R
packages
for inspiration and several plot examples.