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 for ggplot2

A dark theme for ggplot2 and R palette.

Hex image courtesy of DALL·E 2

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("scale_fill_dracula(discrete = FALSE)") +
  scale_fill_dracula(discrete = FALSE) + theme_dracula()

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

dsub <- subset(diamonds, x > 5 & x < 6 & y > 5 & y < 6)
dsub$diff <- with(dsub, sqrt(abs(x - y)) * sign(x - y))

ggplot(dsub, aes(x, y, colour = diff)) +
  geom_point() +
  ggtitle("scale_color_dracula(discrete = FALSE)") +
  scale_color_dracula(discrete = FALSE) +
  theme_dracula()

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

mpg %>%
  filter(manufacturer %in% c("honda", "ford", "dodge", "audi")) %>%
  group_by(manufacturer) %>%
  summarize(mean_hwy = mean(hwy)) %>%
  ggplot(aes(x = manufacturer, y = mean_hwy, fill = manufacturer)) +
  ggtitle("scale_fill_dracula(discrete = TRUE)") +
  theme_dracula() +
  theme(axis.text.y = element_blank(), axis.title.y = element_blank()) +
  coord_flip() + geom_col() +
  scale_fill_dracula(discrete = TRUE)

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