(dplyr)
library(scales)
library(tidytext)  # for reorder_within() and scale_x_reordered()

# Create a polished plot
plot_predictions(fit_stops$fit,
                 newdata = "balanced",
                 condition = c("zone", "race", "sex"),
                 draw = FALSE) |&gt; 
  as_tibble() |&gt; 
  group_by(zone, sex) |&gt; 
  mutate(sort_order = estimate[race == "Black"]) |&gt; 
  ungroup() |&gt; 
  mutate(zone = reorder_within(zone, sort_order, sex)) |&gt; 
  ggplot(aes(x = zone, 
      