# Get primary colors for specific institutions
get_bigten_colors(c("Michigan", "Ohio State", "MSU"))
# Get secondary colors
get_bigten_colors(c("Michigan", "Northwestern"), type = "secondary")
# Use in ggplot with scale_fill_manual
library(ggplot2)
my_colors <- get_bigten_colors(c("Michigan", "Ohio State", "MSU"))
BigTenData <- data.frame(
institution = c("Michigan", "Ohio State", "MSU"),
value = c(10, 15, 20)
)
ggplot(data=BigTenData) +
geom_bar(aes(x = institution, y = value, fill = institution),
stat="identity") +
scale_fill_manual(values = my_colors)
Run the code above in your browser using DataLab