Learn R Programming

ggredist

ggredist provides ggplot2 extensions for political mapmaking, including new geometries, easy label generation and placement, automatic map coloring, and map scales, palettes, and themes.

Here’s an example of what you can do with the package.

library(ggredist)
library(ggplot2)

data(oregon)

ggplot(oregon, aes(group=cd_2020)) +
  # 'ndv' and 'nrv' contain D and R vote counts
  geom_district(aes(fill=ndv, denom=ndv+nrv), linewidth=0.9) +
  geom_district_text() +
  # can then highlight towns and cities
  geom_places(state = 'OR') + 
  # we can overlay county boundaries and labels
  geom_district(aes(group=county), linewidth=0.2, linetype="dashed", fill=NA) +
  geom_district_text(aes(group=county, label=toupper(county)),
                     size=2.2, check_overlap=TRUE) +
  scale_fill_party_b(limits=c(0.4, 0.6)) +
  theme_map()

See more in the reference.

Installation

You can install the development version of ggredist from GitHub with:

# install.packages("remotes")
remotes::install_github("alarm-redist/ggredist")

Copy Link

Version

Install

install.packages('ggredist')

Monthly Downloads

229

Version

0.0.4

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Christopher T. Kenny

Last Published

October 1st, 2025

Functions in ggredist (0.0.4)

zoom

Zoom in to a subset of a plot
scale_fill_wiki_rep

Wikipedia Style Election Map scales for ggplot2
theme_map

Map Theme
cities

U.S. Cities
oregon

Oregon Redistricting File
interstates

Insterstate Shapefile
map_coloring

Produce a Map Coloring
geom_district

Aggregate and Plot Map Regions
label_party_margin

Label Partisan Vote Shares
scale_fill_jacksonville

Jacksonville and Florida Color Scales for ggplot2
scale_fill_texas

Texas Color Scales for ggplot2
scale_fill_dra

Dave's Redistricting App classic scale for ggplot2
scale_fill_washington

Washington Redistricting Commission Color Scales for ggplot2
scale_fill_penn82

Historical Pennsylvania Color Scale for ggplot2
scale_fill_randmcnally

Rand-McNally and National Geographic Color Scales for ggplot2
scale_fill_538

FiveThirtyEight scales for ggplot2
scale_fill_alaska

Alaska Color Scales for ggplot2
scale_party

Partisan scales for ggplot2
scale_fill_coast

Nature-derived Color Scales for ggplot2
stat_cities

Annotate a Map with Roads and Cities
geom_places

Emphasize Populated Regions of a Map with greyed out Places
ggredist

Redistricting Color Palettes
geom_district_text

Label Map Regions