strip label is cut off when using facet_wrap and hjust


I'm attempting to recreate something like the plot here. I'd like the strip label to be left aligned along with the plot title, but left justifying the label cuts it off (as in the example below). As always, I appreciate the help.

convicted <- c(0.68, 0.33)
incarcertated <- c(0.48, 0.12)

df <- data.frame(convicted, incarcertated, group) %>% 
  pivot_longer(c(convicted, incarcertated), 
               names_to = "status", values_to = "value")

df %>% 
  ggplot(aes(x=value, y=status, fill=group)) + 
  facet_wrap(~group, ncol=1) +
  geom_col(width = .33) +
  scale_fill_manual(values=c("#058cd3", "#ff2700")) +
  geom_col(aes(x=1, y=status),
           alpha = .1,
           fill = "#aaaaaa",
           width = .33) +
  geom_text(aes(label=round(100*value)), hjust=-0.5) +
  labs(title = "What Percentage of Crimininal Defendants Are\nConvicted and Incarcerated?",
       subtitle = "Felony defendents in the general population, (2006) vs.\nlaw enforcement officers accused of misconduct (2009-10)"
       ) +
  theme_minimal() +
  theme(legend.position = "none",
        panel.grid = element_blank(),
        axis.title = element_blank(),
        axis.text.x = element_blank(),
        plot.title.position = "plot",
        strip.text.x = element_text(hjust = -0.02))

Created on 2021-11-30 by the reprex package (v2.0.0)

Not a solution but a tip.
If you disable them_minimal, you will understand the cause of your issue.
I suppose that one solution might be to shift the things at the left of the facet labels further right, rather than trying the labels further left.

Sure, disabling the theme shows that the label is cut off at the edge of the strip. In the example I linked to, however, the label seems to float over the edge of the strip. I'm not sure what I'm doing differently. If shifting the things at the left of the facet labels further right works, then I'd be fine with that solution, but I'm not sure how to do that either.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.