How do I remove the blank area behind 0 in my plots?

I want to remove the white space behind the lowest x-axis value in my plot. How do I get rid of this?

Image Reference: https://imgur.com/l7ESU4e

UPDATE : I found the solution. I just added two lines. One removing the expansion and the other expanding the right side. (I might have worded this incorrectly, I'm sorry as English is not my native language.)

scale_y_continuous(expand = c(0,0)) +
  expand_limits(y = c(0, 400)) # Could be anything depending on the values of the axis

Output : https://imgur.com/a/IVhGlD8

I'm glad you found a solution to your issue.

Just for future reference, you are more likely to find help here (and is also a polite thing to do on any programming related forum) if you include a proper minimal REPRoducible EXample (reprex) illustrating your issue.

Also, if your question's been answered (even by you!), would you mind choosing a solution? It helps other people see which questions still need help, or find solutions if they have similar problems. Here’s how to do it:

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