Colour and fill scales that take their colors from a WNBA team, the
ggplot2 counterpart of wnba.colors. scale_color_wnba is an alias for
scale_colour_wnba.
Usage
scale_colour_wnba(set, discrete = TRUE, reverse = FALSE, legacy = FALSE, ...)
scale_color_wnba(set, discrete = TRUE, reverse = FALSE, legacy = FALSE, ...)
scale_fill_wnba(set, discrete = TRUE, reverse = FALSE, legacy = FALSE, ...)Arguments
- set
Character string naming a WNBA team. See
colorr.teams("wnba").- discrete
Logical.
TRUE(the default) builds a discrete scale;FALSEbuilds a continuous gradient through the team's colors.- reverse
Logical. If
TRUE, reverse the color order.- legacy
Logical. If
TRUE, use the palette that shipped with colorr 1.0.1.- ...
Passed on to
discrete_scalewhendiscreteisTRUE, otherwise toscale_fill_gradientnorscale_colour_gradientn.
See also
wnba.colors for the raw palette, colorr.pal for the
palette function.
Author
Charles Crabtree charles.crabtree@monash.edu
Examples
library(ggplot2)
ggplot(mtcars, aes(factor(cyl), mpg, fill = factor(cyl))) +
geom_boxplot() +
scale_fill_wnba("liberty") # New York Liberty
ggplot(mtcars, aes(wt, mpg, colour = hp)) +
geom_point(size = 3) +
scale_colour_wnba("liberty", discrete = FALSE)