Skip to content

Instantly share code, notes, and snippets.

@whatalnk
Last active August 29, 2015 14: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 whatalnk/50e4a9a4503a57bb98bf to your computer and use it in GitHub Desktop.
Save whatalnk/50e4a9a4503a57bb98bf to your computer and use it in GitHub Desktop.
default color palette of ggplot2
gg_color_hue <- function(n, l=65) {
  hues <- seq(15, 375, length=n+1)
  hcl(h=hues, l=l, c=100)[1:n]
}
  • when variable is 5
col.v <- gg_color_hue(5)
  • convert to RGB
col2rgb(col.v)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment