library(ggplot2)
library(ggforma)

counts <- marginSums(HairEyeColor, c("Hair", "Eye"))
ggmosaic(counts, shade = "hcl", cuts = c(2, 4), labeling = "border", label = NULL) +
  labs(title = "Departures from independence", subtitle = "Signed Pearson residuals at descriptive thresholds of 2 and 4")
