theme_td_grid | R Documentation |
This theme is just theme_bw()
with some slight tweaks, like softer colors
and Droid Serif as the default font.
theme_td_grid( base_size = 12, base_family = "Droid Serif", base_line_size = base_size/24 )
base_size |
base font size in pts. |
base_family |
base font family. |
base_line_size |
base size for line elements. |
The complete theme.
library(ggplot2) library(palmerpenguins) library(dplyr) # Load the default font (Droid Serif) extrafont::loadfonts(quiet = TRUE) p <- penguins %>% filter(!is.na(flipper_length_mm)) %>% ggplot(aes(x = flipper_length_mm, y = species)) + geom_violin(aes(fill = species), show.legend = FALSE) + labs(x = "Flipper length (mm)", y = NULL) + facet_wrap(~year) + scale_fill_brewer(palette = "Set1") + scale_x_continuous(breaks = seq(180, 220, 20)) p + theme_td_grid()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.