These functions provide color and fill scales for ggplot2 based on college basketball team and conference colors.
Usage
scale_color_cbb_teams(
type = c("primary", "secondary"),
values = NULL,
...,
aesthetics = "colour",
breaks = ggplot2::waiver(),
na.value = "grey50",
guide = NULL,
alpha = NA
)
scale_colour_cbb_teams(
type = c("primary", "secondary"),
values = NULL,
...,
aesthetics = "colour",
breaks = ggplot2::waiver(),
na.value = "grey50",
guide = NULL,
alpha = NA
)
scale_fill_cbb_teams(
type = c("primary", "secondary"),
values = NULL,
...,
aesthetics = "fill",
breaks = ggplot2::waiver(),
na.value = "grey50",
guide = NULL,
alpha = NA
)
scale_color_cbb_conferences(
type = c("primary", "secondary"),
values = NULL,
...,
aesthetics = "colour",
breaks = ggplot2::waiver(),
na.value = "grey50",
guide = NULL,
alpha = NA
)
scale_colour_cbb_conferences(
type = c("primary", "secondary"),
values = NULL,
...,
aesthetics = "colour",
breaks = ggplot2::waiver(),
na.value = "grey50",
guide = NULL,
alpha = NA
)
scale_fill_cbb_conferences(
type = c("primary", "secondary"),
values = NULL,
...,
aesthetics = "fill",
breaks = ggplot2::waiver(),
na.value = "grey50",
guide = NULL,
alpha = NA
)Arguments
- type
The type of color scale, either
"primary"or"secondary".- values
A named list of colors to be used if overriding the default team or conference colors.
- ...
Arguments passed on to
discrete_scalepaletteA palette function that when called with a single integer argument (the number of levels in the scale) returns the values that they should take (e.g.,
scales::pal_hue()).breaksOne of:
limitsOne of:
NULLto use the default scale valuesA character vector that defines possible values of the scale and their order
A function that accepts the existing (automatic) values and returns new ones. Also accepts rlang lambda function notation.
dropShould unused factor levels be omitted from the scale? The default,
TRUE, uses the levels that appear in the data;FALSEuses all the levels in the factor.na.translateUnlike continuous scales, discrete scales can easily show missing values, and do so by default. If you want to remove missing values from a discrete scale, specify
na.translate = FALSE.na.valueIf
na.translate = TRUE, what aesthetic value should the missing values be displayed as? Does not apply to position scales whereNAis always placed at the far right.aestheticsThe names of the aesthetics that this scale works with.
scale_nameThe name of the scale that should be used for error messages associated with this scale.
labelsOne of:
NULLfor no labelswaiver()for the default labels computed by the transformation objectA character vector giving labels (must be same length as
breaks)An expression vector (must be the same length as breaks). See ?plotmath for details.
A function that takes the breaks as input and returns labels as output. Also accepts rlang lambda function notation.
callThe
callused to construct the scale for reporting messages.superThe super class to use for the constructed scale
- aesthetics
The ggplot2 aesthetic to apply the scale to, defaults to
"colour"or"fill".- breaks
A set of breaks for the scale, defaults to
ggplot2::waiver().- na.value
The color to use for missing values.
- guide
A guide for the scale, such as a legend.
- alpha
Transparency level 0-1, applied to all colors if not
NA.
Functions
scale_color_cbb_teams(): Provides color scales for college basketball teams.scale_fill_cbb_teams(): Provides fill scales for college basketball teams.scale_color_cbb_conferences(): Provides color scales for college basketball conferences.scale_fill_cbb_conferences(): Provides fill scales for college basketball conferences.