In ggplot2 the histogram fill categories are ordered alphabetically. I would like to assign a custom order to my fill as such:
cust_order <- c("Goal", "Shot on target", "Shot blocked", "Wide shot")
This is different from reordering the colors as described here: How do you order the fill-colours within ggplot2 geom_bar.Code so far...
shot_df %>% filter(Team == "Team A") %>%
ggplot(., aes(x = xG, fill=Type)) +
geom_histogram(binwidth = 0.10)
And the final (alphabetical) output:
Thanks!