nhl-scales: ggplot2 scales from an NHL team palette

nhl-scalesR Documentation

ggplot2 scales from an NHL team palette

Description

Colour and fill scales that take their colors from an NHL team, the ggplot2 counterpart of nhl.colors. scale_color_nhl is an alias for scale_colour_nhl.

Usage

scale_colour_nhl(set, discrete = TRUE, reverse = FALSE, legacy = FALSE, ...)

scale_color_nhl(set, discrete = TRUE, reverse = FALSE, legacy = FALSE, ...)

scale_fill_nhl(set, discrete = TRUE, reverse = FALSE, legacy = FALSE, ...)

Arguments

set

Character string naming an NHL team. See colorr.teams("nhl").

discrete

Logical. TRUE (the default) builds a discrete scale; FALSE builds 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_scale when discrete is TRUE, otherwise to scale_fill_gradientn or scale_colour_gradientn.

Value

A ggplot2 scale, to be added to a plot with +.

Author(s)

Charles Crabtree charles.crabtree@monash.edu

See Also

nhl.colors for the raw palette, colorr.pal for the palette function.

Examples

library(ggplot2)

ggplot(mtcars, aes(factor(cyl), mpg, fill = factor(cyl))) +
 geom_boxplot() +
 scale_fill_nhl("kraken")   # Seattle Kraken

ggplot(mtcars, aes(wt, mpg, colour = hp)) +
 geom_point(size = 3) +
 scale_colour_nhl("kraken", discrete = FALSE)

colorr documentation built on Aug. 22, 2026, 5:08 p.m.