ggalt 0.6.2
  • Reference
  • Articles
    • Annotation Ticks
    • Density Plots
    • Dumbbell Charts
    • Encircling Points
    • Horizon Plots
    • Lollipop charts
    • Coord Projection
    • Spikelines
    • Spline Plots
    • ProPublica StateFace
    • Step Ribbons
    • Uniform Bars
    • Vertical Dodging
  • Changelog

ProPublica StateFace

Bob Rudis

2019-02-22

Source: vignettes/stateface.Rmd
stateface.Rmd

ProPublica StateFace

Run show_stateface() to see the location of the TTF StateFace font: You need to install it for it to work.

library(ggplot2)
library(gridExtra)
library(ggalt)
library(scales)

set.seed(1492)

dat <- data.frame(state=state.abb,
                  x=sample(100, 50),
                  y=sample(100, 50),
                  col=sample(c("#b2182b", "#2166ac"), 50, replace=TRUE),
                  sz=sample(6:15, 50, replace=TRUE),
                  stringsAsFactors=FALSE)

gg <- ggplot(dat, aes(x=x, y=y))

gg <- gg + geom_stateface(aes(label=state, color=col, size=sz))

gg <- gg + scale_color_identity()

gg <- gg + scale_size_identity()

gg

Contents

  • ProPublica StateFace

Developed by Bob Rudis, Ben Bolker, Jan Schulz, Aditya Kothari, Jonathan Sidi.

Site built with pkgdown.