Skip to content

Instantly share code, notes, and snippets.

@topfunky
Created March 11, 2022 18:57
Show Gist options
  • Save topfunky/a7c5c53d6b56411a98bfcf96ae057841 to your computer and use it in GitHub Desktop.
Save topfunky/a7c5c53d6b56411a98bfcf96ae057841 to your computer and use it in GitHub Desktop.
# As seen at https://topfunky.com/2021/ggplot-high-contrast-theme-gghighcontrast/
foreground_color = "white"
background_color = "black"
ggplot(data,
aes(
x = year,
y = revenue,
group = product,
linetype = product
)) +
geom_line(color = foreground_color,
size = 1) +
theme_high_contrast(
foreground_color = foreground_color,
background_color = background_color
) +
theme(legend.position = "none") +
scale_linetype_high_contrast() +
labs(title = "CRT Sales, 1979-1982",
subtitle = "Non-GAAP, worldwide",
caption = "Data from example.com")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment