ggdatalab is a small ggplot2 extension that provides:
- a consistent theme (
theme_datalab()) - discrete and continuous colour scales built from a fixed palette
- simple palette helpers for reuse outside ggplot
The package is written to be R CMD check clean and suitable for CRAN submission.
When available on CRAN:
install.packages("ggdatalab")install.packages("remotes")
remotes::install_github("kubdatalab/ggdatalab", build_vignettes = TRUE)library(ggplot2)
library(ggdatalab)
ggplot(mtcars, aes(wt, mpg, colour = hp)) +
geom_point(size = 3) +
scale_colour_datalab_c() +
theme_datalab()theme_datalab()
A minimal theme based on theme_minimal() with restrained grid lines and sensible typography defaults.
scale_fill_datalab_d()scale_colour_datalab_d()scale_color_datalab_d()(US spelling)
scale_fill_datalab_c()scale_colour_datalab_c()scale_color_datalab_c()(US spelling)
datalab_cols()datalab_pal(type = c("discrete", "continuous"))
vignette("using-ggdatalab")Or:
browseVignettes("ggdatalab")Issues and pull requests are welcome. Please include a minimal reproducible example when reporting bugs.
MIT © KUB Datalab
