Skip to content

Instantly share code, notes, and snippets.

@will-r-chase
Created May 9, 2022 01:05
Show Gist options
  • Save will-r-chase/e81efb4347a7e9207616d2055185b13b to your computer and use it in GitHub Desktop.
Save will-r-chase/e81efb4347a7e9207616d2055185b13b to your computer and use it in GitHub Desktop.
library(tidyverse)
library(ggtext)
##Your turn
#Use ggtext to make the word 'plastic' bold in the title
#and wrap the subtitle so it is multi-line
plastics <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2021/2021-01-26/plastics.csv')
plastics %>%
group_by(year) %>%
summarize(total = sum(grand_total, na.rm = TRUE)) %>%
ggplot() +
geom_bar(aes(x = "", y = total, fill = as.character(year)), stat = "identity", width = 1) +
coord_polar("y", start = 0) +
theme_minimal() +
labs(title = "Plastic pollution, by year", fill = "",
subtitle = "This is a really really really long subtitle that has tons of detail about your methods and data and even more info beyond that") +
theme(axis.title = element_blank(), panel.grid = element_blank(),
axis.text = element_blank())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment