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()
Run the code above in your browser using DataLab