Skip to content

Instantly share code, notes, and snippets.

@mattgalbraith
Created February 1, 2023 18:27
Show Gist options
  • Save mattgalbraith/82d7879faea4ec871b9255f71ec5316b to your computer and use it in GitHub Desktop.
Save mattgalbraith/82d7879faea4ec871b9255f71ec5316b to your computer and use it in GitHub Desktop.
R function to get hex codes for standard ggplot colors
# get standard ggplot colors
gg_color_hue <- function(n) {
hues = seq(15, 375, length = n + 1)
hcl(h = hues, l = 65, c = 100)[1:n]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment