A convenience wrapper for comparing albums with color. In contrast to
scale_colour_albums() use a single palette, with
one color per album. Specifically, the
album_compare palette is used to
apply a color associated with each album.
Other arguments to be passed to
The names of the aesthetics that this scale works with.
NULL for no breaks
waiver() for the default breaks (the scale limits)
A character vector of breaks
A function that takes the limits as input and returns breaks as output
NULL to use the default scale values
A character vector that defines possible values of the scale and their order
A function that accepts the existing (automatic) values and returns new ones
na.translate = TRUE, what aesthetic value should the
missing values be displayed as? Does not apply to position scales
NA is always placed at the far right.
A color scale for use in plots created with
library(ggplot2) studio <- subset(taylor_albums, !is.na(metacritic_score)) # create a plot that we want to color or fill by album ggplot(studio, aes(x = metacritic_score, y = album_name)) + geom_col(aes(fill = album_name)) # apply a color inspired by each album cover ggplot(studio, aes(x = metacritic_score, y = album_name)) + geom_col(aes(fill = album_name)) + scale_fill_albums() # even when the axis or levels are rearranged, the correct color is applied studio$album_name <- factor(studio$album_name, levels = album_levels) ggplot(studio, aes(x = metacritic_score, y = album_name)) + geom_col(aes(fill = album_name)) + scale_fill_albums()