Created
August 12, 2015 17:49
-
-
Save bholt/38fc80d5d5b377cb3302 to your computer and use it in GitHub Desktop.
Custom color scheme for ggplot
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
c.blue <- "#0072B2" | |
c.yellow <- "#E69F00" | |
c.green <- "#009E73" | |
c.red <- "#D55E00" | |
c.pink <- "#CC79A7" | |
c.gray <- "#999999" | |
palette <- c( | |
'follow'=c.blue, | |
'newuser'=c.yellow, | |
'post'=c.green, | |
'repost'=c.red, | |
'timeline'=c.pink, | |
) | |
color_scales <- function(title, palette) | |
list( | |
scale_fill_manual(values=palette, name=title), | |
scale_color_manual(values=palette, name=title) | |
) | |
ggplot(...)+color_scales(title='Transaction Type') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
(where
follow
,newuser
, etc are levels in a factor you wish to color)