Created
May 26, 2017 11:52
-
-
Save naarkhoo/4629f1b2daff568b15105d66a61fc96a to your computer and use it in GitHub Desktop.
Get color codes of a ggplot figure
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ggplotColours <- function(n = 6, h = c(0, 360) + 15){ | |
if ((diff(h) %% 360) < 1) h[2] <- h[2] - 360/n | |
hcl(h = (seq(h[1], h[2], length = n)), c = 100, l = 65) | |
} | |
ggplotColours(n = 3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment