relig_income |>
- pivot_longer(cols = -religion,
- names_to = "income_category",
- values_to = "income") |>
- mutate(religion = fct_relevel(religion, "Evangelical Prot", "Mainline Prot", "Catholic", "Unaffiliated", "Historically Black Prot")) |>
- mutate(income_category = fct_rev(as_factor(income_category))) |>
- ggplot(aes(income, income_category)) +
- geom_col(fill = "#eee8d5") +
- facet_wrap(vars(
- fct_other(
- religion,
- keep = c("Evangelical Prot", "Mainline Prot", "Catholic", "Unaffiliated", "Historically Black Prot")))) +
- theme(plot.background = element_rect(fill = "#002b36"),
- text = element_text(color = "#eee8d5"),
- axis.text = element_text(color = "#eee8d5"),
- panel.background = element_rect(fill = "#002b36"),
- panel.grid = element_line(color = "#002b36"),
- strip.background = element_rect(fill = "#7b9c9f"))
-