https://github.com/dracula/dracula
🧛🏻♂️ Dark theme for R
https://github.com/dracula/dracula
dark-theme dracula dracula-color-scheme dracula-theme ggplot2 ggplot2-themes r theme
Last synced: 3 months ago
JSON representation
🧛🏻♂️ Dark theme for R
- Host: GitHub
- URL: https://github.com/dracula/dracula
- Owner: dracula
- License: other
- Created: 2021-11-28T00:24:17.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-03-06T19:05:19.000Z (4 months ago)
- Last Synced: 2025-03-29T05:22:04.861Z (4 months ago)
- Topics: dark-theme, dracula, dracula-color-scheme, dracula-theme, ggplot2, ggplot2-themes, r, theme
- Language: R
- Homepage: https://draculatheme.com/R
- Size: 3.56 MB
- Stars: 34
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
---
output: github_document
---```{R options, echo = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README/",
fig.retina = 2,
fig.width = 5,
fig.height = 4
)
```# {`dRacula`} | Dracula Theme for R
[](https://github.com/dracula/dRacula/actions/workflows/R-CMD-check.yaml)
> All things Dracula themed for R
## Install
All instructions can be found at [draculatheme.com/R](https://draculatheme.com/R).
```{R devtools-install, echo=TRUE, eval=FALSE, output=FALSE}
devtools::install_github("dracula/dRacula")
```
or
```{R remotes-install, echo=TRUE, eval=FALSE, output=FALSE}
remotes::install_github("dracula/dRacula")
```## Examples
Add a Dracula-themed `_brand.yaml` to your project:
```{R brand, output=TRUE, message=FALSE}
library(dRacula)
dracula_brand()
```
Apply the Dracula theme and color scale to a linear regression plot:
```{R mpg-lm-example, output=TRUE, eval=TRUE, message=FALSE, warning=FALSE, fig.align='center'}
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:
```{R proportion, fig.align='center'}
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](https://github.com/dracula/dRacula/graphs/contributors).
| [](https://github.com/jrdnbradford) |
| --------------------------------------------------------------------------------------------------- |
| [Jordan Bradford](https://github.com/jrdnbradford) |## Community
- [X](https://x.com/draculatheme) - Best for getting updates about themes and new stuff.
- [GitHub](https://github.com/dracula/dracula-theme/discussions) - Best for asking questions and discussing issues.
- [Discord](https://draculatheme.com/discord-invite) - Best for hanging out with the community.## Contributing
See [`CONTRIBUTING.md`](/.github/CONTRIBUTING.md).## Acknowledgments
I'm indebted to the {[viridis](https://sjmgarnier.github.io/viridis)} and {[wesanderson](https://github.com/karthik/wesanderson)} `R` packages for inspiration and several plot examples.
## License
[MIT License](./LICENSE)