Assistant Professor of Political Science, Yale University
Resident Fellow at the Institution of Social and Policy Studies
Version 0.1 — 2026-08-22
When creating a visualization, especially with R and ggplot2, start with these principles, aesthetic preferences, and settings as strong defaults. Deviate from them only with the user’s explicit request or permission.
stringr::str_wrap(). Prefer meaningful endpoint labels and a shared
direction cue when every intermediate x-axis label would be redundant.caption
configuration.\usepackage[
margin=30pt,
labelfont=bf,
labelsep=endash,
font=normalsize
]{caption}
\caption{} with a boldfaced short title and keep the entire caption
short enough to fit on one rendered line. Put explanatory notes in a
minipage below the figure or table and begin them with \emph{Note}.ggplot2::theme_classic(base_size = 11) or
ggplot2::theme_classic(base_size = 12). Use ggplot2::theme_minimal() for
tile plots where the axes are not the visual frame.ggplot2::geom_point() with
ggplot2::geom_linerange(). If using ggplot2::geom_errorbar(), omit end
caps with width = 0.scales::label_percent() for proportions displayed as
percentages. For differences stored as proportions but displayed in
percentage points, use scales::label_number(scale = 100, suffix = " pp").
If values are already stored in percentage points, use the suffix without
rescaling.scales label function.ggh4x::facet_wrap2() or
ggh4x::facet_grid2() with axes = TRUE. Set remove_labels appropriately
to suppress repeated inner-panel tick labels; do not use
ggplot2::facet_wrap() or ggplot2::facet_grid().wacolors package by default instead of ggplot2’s default discrete palette.
Viridis palettes are also acceptable. Reuse the same named palette for the
same concepts within a project.ggplot2::scale_fill_fermenter() with a ColorBrewer palette over an unbroken
continuous gradient. If values are already categorical, use
ggplot2::scale_fill_brewer() or an appropriate manual discrete scale.direction = -1, set
direction = 1. Leave the default direction of Viridis palettes unchanged.ggredist$partisan palette defined by Cory McCartan and Christopher T. Kenny:
https://github.com/alarm-redist/ggredist/blob/main/R/colors.R. Use neutral
gray for independents; use green only when gray already has another semantic
role.ggplot2::labs(x = NULL). Do not print
“Year” when the meaning is obvious from context.patchwork to combine figures.patchwork::plot_layout(guides = "collect").grDevices::cairo_pdf when text or Unicode rendering benefits from it.01 and 02.This work provides useful background but is lower priority than the specific instructions above:
AGENTS.md, when present.