Partisan scales for ggplot2
Usage
scale_fill_party_c(
name = "Vote share",
midpoint = 0.5,
limits = 0:1,
labels = label_party_pct(),
oob = scales::squish,
reverse = FALSE,
...
)
scale_color_party_c(
name = "Vote share",
midpoint = 0.5,
limits = 0:1,
labels = label_party_pct(),
oob = scales::squish,
reverse = FALSE,
...
)
scale_fill_party_d(labels = c("Rep.", "Dem."), reverse = FALSE, ...)
scale_color_party_d(labels = c("Rep.", "Dem."), reverse = FALSE, ...)
scale_fill_party_b(
name = "Vote share",
midpoint = 0.5,
limits = 0:1,
labels = label_party_pct(),
oob = scales::squish,
reverse = FALSE,
nice.breaks = FALSE,
...
)
scale_color_party_b(
name = "Vote share",
midpoint = 0.5,
limits = 0:1,
labels = label_party_pct(),
oob = scales::squish,
reverse = FALSE,
nice.breaks = FALSE,
...
)
scale_colour_party_d(labels = c("Rep.", "Dem."), reverse = FALSE, ...)
scale_colour_party_c(
name = "Vote share",
midpoint = 0.5,
limits = 0:1,
labels = label_party_pct(),
oob = scales::squish,
reverse = FALSE,
...
)
scale_colour_party_b(
name = "Vote share",
midpoint = 0.5,
limits = 0:1,
labels = label_party_pct(),
oob = scales::squish,
reverse = FALSE,
nice.breaks = FALSE,
...
)
Arguments
- name
Name for scale. Default is
"Vote share"
.- midpoint
Scale midpoint value. Default is
0.5
.- limits
Lower and upper limits for scale. Default is
0:1
.- labels
Function to adjust scale labels. Default is
scales::percent
.- oob
Function to deal with out of bounds. Default is
scales::squish()
.- reverse
Whether to reverse red and blue.
- ...
Additional arguments to
ggplot::scale_*
functions- nice.breaks
If
TRUE
, attempt to place breaks at nice values instead of exactly evenly spaced between the limits.