I'm trying to adjust each individual x-axis label by adding an annotation.
I'm able to adjust the first two labels, but the next 6 just repeat those first two, instead of taking on their own individual labels (the numbers should be different).
Here's the scale_x_discrete
part of my ggplot script:
scale_x_discrete(
# Change x group labels
labels = c(
paste0("PPA\n(", comma(PPA_LA_2019, digits = 0), "\ntotal)"),
paste0("Non-PPA\n(", comma(non_PPA_LA_2019, digits = 0), "\ntotal)"),
paste0("PPA\n(", comma(PPA_LA_2020, digits = 0), "\ntotal)"),
paste0("Non-PPA\n(", comma(non_PPA_LA_2020, digits = 0), "\ntotal)"),
paste0("PPA\n(", comma(PPA_LA_2021, digits = 0), "\ntotal)"),
paste0("Non-PPA\n(", comma(non_PPA_LA_2021, digits = 0), "\ntotal)"),
paste0("PPA\n(", comma(PPA_LA_2022, digits = 0), "\ntotal)"),
paste0("Non-PPA\n(", comma(non_PPA_LA_2022, digits = 0), "\ntotal)")
)
) +
Here are the values I want to be showing up across the x-axis: x-axis label values
And here's what I'm getting: current x-axis