- default color palette of ggplot2
- [R] ggplot2の色をプレゼンでも使いたい
scale_colour_hue(), luminance=65
- n: number of variables
- l: luminance
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)