0

I can't figure out how to force the y-intercept of my bar graph to start at zero instead of below zero. I've tried using the commands expand_limits(), and scale_y_discrete(), but neither seem to be working. I've copy and pasted my code below and included a picture of the bar plot. Thanks in advance!

plot <- ggplot(df, aes(x = Age.Group, y = Total, fill = factor(Sex))) + 
  geom_bar(stat = "identity", position = "dodge") + 
  scale_fill_grey(name = "Gender", breaks = c(1,2), labels = c("Male", "Female")) + 
  xlab("Age Group") + 
  ylab("Number of Respondents") + 
  theme(text = element_text(size = 12, family = "TT Times New Roman")) + 
  expand_limits(y = 0) + 
  theme_bw()

enter image description here

Mako212
  • 6,787
  • 1
  • 18
  • 37
Sahana
  • 3
  • 1

0 Answers0