Is a collection of my submissions to #TidyTuesday from Twitter. For more information about #TidyTuesday see their GitHub repo or see the latest postings on Twitter.
These are the packages I find very useful in developing my charts:
- tidyverse - data manipulation and plotting
- tidytuesday - importing the TidyTuesday data sets
- glue - joining strings and more
- scales - formatting axis and labels
- showtext - importing and customizing fonts
- ggtext - better text rendering
- cowplot - combining plots and simply themes
- waffle - making waffle plots
Two fonts families are predominately used: Lato
and Merriweather
. Lato
is a san-serif font that is in the title and Merriweather
is a serif font used in all other typography. Both are Google fonts. The textual chart components are sized based on their importance and to not distract from the data-encoding objects in the charts.
The title, subtitle, legend, and caption (source and notes) are left aligned. Furthermore, all text should horizontal. For the y-axis' title, it should not be used and the axis will be descirbed in the subtitle.
My font style can be applied with:
library(showtext)
library(tidyverse)
font_add_google("Lato", "Lato")
font_add_google("Merriweather", "Merriweather")
showtext_auto()
# WIP
theme(
text = element_text(family = "Merriweather", size = 12),
plot.title = element_text(family = "Lato", size = rel(1.5)),
plot.subtitle = element_text(size = rel(1.25)),
axis.text = element_text(size = rel(0.875)),
legend.text = element_text(size = rel(0.875)),
)
The default font size is 12 points, which is ideal for charts smaller than 5 inches wide. For wider fonts, up to 8 inches, use 14 points.
(WIP)