After working on a graph scheme for Stata that used University of Michigan colors, I’ve been inspired to try something similar in R. In R, one way to do this is to define a color palette:

# Michigan color palette per 
# http://vpcomm.umich.edu/brand/style-guide/design-principles/colors
 
# CMYK to RGB conversion from http://www.codecrete.net/CMYK
 
# colors can be re-ordered per preference
 
michigan_colors=c("#00274c", # blue
                  "#ffcb05", # maize
                  "#a4270b", # tappan red
                  "#e96300", # ross school orange
                  "#beb300", # wave field green
                  "#21c1bc", # taubman teal
                  "#2878ba", # arboretum blue
                  "#7207a5") # ann arbor amethyst
# name individual colors

michigan_blue <- "#00274c"

michigan_maize <- "#ffcb05"

tappan_red <- "#a4270b"

ross_school_orange <- "#e96300"

wave_field_green <- "#beb300"

taubman_teal <- "#21c1bc"

arboretum_blue <- "#2878ba"

ann_arbor_amethyst <- "#7207a5"

You can then use this color palette in various graphs as I’ve done in the scripts included in this page. To see the code for the relevant sections, see the CODE buttons along the right hand side of this page.

# iris data set
 
data(iris)
library(png)

library(jpeg)

library(grid)

img <- readJPEG("Iris_germanica_(Purple_bearded_Iris),_Wakehurst_Place,_UK_-_Diliff.jpg")

grid.raster(img)

Image Credit

In the graph examples below, I use the famous “Iris” data set collected by R.A. Fisher. The first several rows of data from this data set are listed below:

Sepal.Length Sepal.Width Petal.Length Petal.Width Species
5.1 3.5 1.4 0.2 setosa
4.9 3 1.4 0.2 setosa
4.7 3.2 1.3 0.2 setosa
4.6 3.1 1.5 0.2 setosa
5 3.6 1.4 0.2 setosa
5.4 3.9 1.7 0.4 setosa

Sample Graphs

Histograms

hist(iris$Petal.Length, col = michigan_colors) 

hist(iris$Petal.Length, col = arboretum_blue)

Barplot

barplot(table(iris$Species), 
        xlab = "Species", 
        ylab = "Frequency",
        col = michigan_colors,
        main = "Species Type in Iris Data Set")

Scatterplots

plot(iris$Sepal.Length, 
     iris$Petal.Length,
     bg = michigan_colors,
     pch = 21,
     main = "Scatterplot of Iris Data Set")

plot(iris$Sepal.Length, 
     iris$Petal.Length,
     bg = taubman_teal,
     pch = 21,
     main = "Scatterplot of Iris Data Set")

Boxplot

boxplot(Sepal.Length ~ Species, 
        ylab = "Sepal Length",
        data = iris,
        main = "Boxplot of Iris Data", 
        col = michigan_colors)


Created by Andy Grogan-Kaylor