Skip to content
generated from dracula/template

🧛🏻‍♂️ Dark theme for ggplot2 and R palette

License

Notifications You must be signed in to change notification settings

dracula/ggplot2

Repository files navigation

{ggDracula} | Dracula Theme for R

R-CMD-check

Dracula logo in an R hex sticker

A dark theme for R, including a ggplot2 theme and palette.

Install

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

devtools::install_github("dracula/ggplot2")

or

remotes::install_github("dracula/ggplot2")

Examples

library(dplyr)
library(ggplot2)
# library(ggDracula)

set.seed(1)
ggplot(data.frame(x = rnorm(10000), y = rnorm(10000)), aes(x = x, y = y)) +
  geom_hex() + coord_fixed() +
  ggtitle("RNORM Hex") +
  scale_fill_dracula(discrete = FALSE) + theme_dracula()

library(dplyr)
library(ggplot2)
library(ggDracula)

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")

Team

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

Jordan Bradford
Jordan Bradford

Community

  • Twitter - 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