| theme_td_minimal | R Documentation |
A plotting theme based off of ggplot2::theme_minimal() and inspired by
Andrew Heiss.
It uses Roboto Condensed as the default font, which may be changed with
the base_family argument.
theme_td_minimal( base_size = 12, base_family = "Roboto Condensed", base_grey = "grey85" )
base_size |
base font size in pts. |
base_family |
base font family. |
base_grey |
the specific grey to use for gridlines, default "greyw85". |
The complete theme.
library(ggplot2)
library(palmerpenguins)
library(dplyr)
# Load the default font (Roboto Condensed)
extrafont::loadfonts(quiet = TRUE)
p <- penguins %>%
filter(!is.na(bill_length_mm)) %>%
ggplot(aes(x = bill_length_mm, y = bill_depth_mm, color = species)) +
geom_point(aes(shape = species), size = 3, alpha = 0.7) +
geom_smooth(method = "lm", formula = "y ~ x", se = FALSE) +
scale_color_brewer(palette = "Set1") +
labs(
title = "Penguin bill dimensions",
subtitle = "Bill length and depth for different penguin species",
x = "Bill length (mm)", y = "Bill depth (mm)",
color = "Penguin species", shape = "Penguin species",
caption = "Data from the palmerpenguins package"
) +
facet_wrap(~species, nrow = 1)
p + theme_td_minimal()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.