0
combined_databike_2 %>% group_by(member_casual, month) %>% summarise(number_of_rides = n()) %>% arrange(member_casual, month)  %>% ggplot(aes(x = month, y = number_of_rides, fill = member_casual)) +geom_col(position = "dodge") + labs(title= "Numbers of rides completed by month",
                                        subtitle= "June 2020 to May 2021")

enter image description here

As you can see the X labels from June through May are stacked and cannot differentiate of which one-month bar is. I tried adding width = 0.5 but did not clear that space when I pressed the RMarkdown.

Any feedback is appreciated.

wkl
  • 77,184
  • 16
  • 165
  • 176
Tails0298
  • 27
  • 7
  • 3
    You could turn your labels 90 degree using this: `+ theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1))`? – Quinten Aug 29 '22 at 15:36
  • 2
    You can also try alternating the labels: try `scale_x_discrete(guide = guide_axis(n.dodge = 2))` for two rows of alternating labels. See https://www.tidyverse.org/blog/2020/03/ggplot2-3-3-0/ – r2evans Aug 29 '22 at 15:43

0 Answers0