A package for R that contains the custom themes I use for ggplot2. This was made for my own personal use but if you would also like to use these themes follow the steps below.
This project is not on CRAN so to download you will need to have the package devtools for R.
devtools::install_github("benchaffe/BensThemes")
To use the fonts you may also need the package extrafont. Simply follow the steps below.
library(extrafont)
font_import()
loadfonts(device = "win")
font_import()
can take around 5 minutes.
theme_belightgray
A modern light gray theme.theme_bewhite
A modern white theme.theme_beblue
A modern blue theme.theme_bedark
A modern dark theme.theme_bedarkish
This is a lighter dark theme.theme_beretro
A retro theme.
Note: all themes have the option axisLabels = TRUE
by default. Simply
set to false to hide axis labels.
ggplot(mtcars, aes(mpg, wt)) +
geom_point() +
labs(title = "Scatterplot of mtcars data",
subtitle = "An example subtitle",
caption = "BensThemes") +
theme_belightgray()
ggplot(mtcars, aes(mpg, wt)) +
geom_point() +
labs(title = "Scatterplot of mtcars data",
subtitle = "An example subtitle",
caption = "BensThemes") +
theme_bewhite()
ggplot(mtcars, aes(mpg, wt)) +
geom_point(color = "white") +
labs(title = "Scatterplot of mtcars data",
subtitle = "An example subtitle",
caption = "BensThemes") +
theme_beblue()
ggplot(mtcars, aes(mpg, wt)) +
geom_point(color = rgb(255, 235, 30, maxColorValue = 255, alpha = 255)) +
labs(title = "Scatterplot of mtcars data",
subtitle = "An example subtitle",
caption = "BensThemes") +
theme_bedark()
ggplot(mtcars, aes(mpg, wt)) +
geom_point(color = rgb(255, 235, 30, maxColorValue = 255, alpha = 255)) +
labs(title = "Scatterplot of mtcars data",
subtitle = "An example subtitle",
caption = "BensThemes") +
theme_bedarkish()
ggplot(mtcars, aes(mpg, wt)) +
geom_point() +
labs(title = "Scatterplot of mtcars data",
subtitle = "An example subtitle",
caption = "BensThemes") +
theme_beretro()