Skip to content

bwiernik/dracula-ggplot2

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

19 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Dracula for ggplot2

A dark theme for ggplot2 and R palette.

MPG Plots

theme_dracula

theme_dracula() provides a minimal ggplot2 theme with a Dracula-ish, dark backdrop.

dracula_palette

dracula_palette() provides the more vibrant colors of Dracula to stand out in front of theme_dracula().

Params

palette <- dracula_palette(num_cols, var_type = c("discrete", "continuous"))

Param num_cols - Number of colors to return. If missing, defaults to the length of the entire palette.

Param var_type - Using var_type = "discrete" will return the number of colors provided by num_cols. dracula_palette() will recycle through the palette if num_cols > 7. Using var_type = "continuous" will create a color ramp with the number of colors provided by num_cols.

Examples

See the beginning of the README for the examples produced.

library(ggplot2)
library(dplyr)
theme_set(theme_dracula())

# Left bar chart
mpg %>%
  group_by(manufacturer) %>%
  summarize(mean_hwy = mean(hwy)) %>%
  ggplot(aes(x = manufacturer, y = mean_hwy, fill = manufacturer)) +
  theme(legend.position = "none") +
  coord_flip() +
  geom_col() +
  scale_fill_manual(
    values = dracula_palette(
      num_col  = nlevels(factor(mpg$manufacturer)),
      var_type = "discrete"
    )
  )

# Right scatterplot
mpg %>%
  ggplot(aes(x = displ, y = cty, color = hwy)) +
  geom_point() +
  scale_colour_gradientn(colors = dracula_palette(var_type = "continuous"))

Install

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

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.

License

MIT License

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • R 100.0%