Skip to content

Instantly share code, notes, and snippets.

@mschnetzer
Last active August 31, 2023 07:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mschnetzer/80990904340dd5f43d9e25274bfa5c77 to your computer and use it in GitHub Desktop.
Save mschnetzer/80990904340dd5f43d9e25274bfa5c77 to your computer and use it in GitHub Desktop.
Sales revenue of vinyl in the US, 1973-2022 (https://twitter.com/matschnetzer/status/1697144639394902260?s=20)
library(tidyverse)
library(ggforce)
library(geomtextpath)
# Download data from here: https://www.riaa.com/u-s-sales-database/
vinyl <- read_csv2("vinyl.csv") |>
select(year = Year, value = `Value (Actual)`)
vinyl |>
ggplot(aes(x = year, y = 1)) +
geom_link(aes(xend = year, yend = 0, linewidth = value), color = "black") +
geom_text(data = vinyl |> filter(year %in% seq(1970, 2030, 10)),
aes(y = 0, label = glue::glue("{abs(year)}")), size = 3, family = "Roboto Condensed", vjust = -.5) +
annotate("label", x = 1999, y = 1.5, label = toupper("Vinyl is back"), hjust = 0.5, size = 9,
family = "Fira Sans", color = "white", fill = "black", label.padding = unit(.5, "lines")) +
annotate("text", x = 1992, y = 1.5, label = "— Sales revenue in the U.S., 1973-2022 —",
hjust = 0.5, size = 4, family = "Roboto Condensed") +
annotate("text", x = 1987, y = 1.5, size = 3, family = "Roboto Condensed",
lineheight = .9, vjust = 1,
label = str_wrap("Vinyl album sales in the United States have grown for 16 consecutive years. In 2022, roughly 41 million EPs and LPs were sold, up more than 45-fold compared to 2006. For the first time since 1987, vinyl albums outsold CDs in units. According to the Recording Industry Association of America (RIAA), revenues in 2022 amounted to 1.2 billion US-Dollar which is, however, well below the 1970s level.", width = 110)) +
geom_textsegment(aes(x = 2024, xend = 2024, yend = 0, label = "Data: RIAA. Figure: @matschnetzer"),
size = 2.2, linewidth = 0, family = "Roboto Condensed", hjust = 0.7, vjust = 0.2) +
scale_linewidth_continuous(range = c(0.5, 1.7)) +
scale_x_continuous(limits = c(1970, NA), expand = c(0, 0)) +
scale_y_continuous(limits = c(0, 2), expand = c(0, 0)) +
coord_polar(theta = "y", start = pi-pi/2, clip = "off") +
theme_void() +
theme(legend.position = "none",
plot.margin = margin(t = -90, b = -30))
ggsave(filename = "vinyl.png", width = 7, height = 5.5, dpi = 320, units = "in", bg = "white")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment