title: Adding some space between the x-axis and the bars, in ggplot
body: <p>I have the following data frame:</p>
  
  <pre><code>df = data.frame(x = c('a', 'b'),
                  y = c(2,4))
  </code></pre>
  
  <p>and the corresponding graph:</p>
  
  <pre><code>ggplot(df, aes(x,y)) + 
    geom_col()
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/PbLnt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PbLnt.png" alt="enter image description here"></a></p>
  
  <p>My scale is going from 1 to 5 so I don't want the 0 to appear on the y axis but want the y axis to start at 1. Yet I still want the blank space below the bars.</p>
  
  <pre><code>ggplot(df, aes(x,y)) + 
    geom_col() + 
    coord_cartesian(ylim = c(1,4)) +
    scale_y_continuous(
      expand = expand_scale(add = c(0.2,0)))
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/9txVV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9txVV.png" alt="enter image description here"></a></p>
  
  <p>As you see, the y axis indeed starts at 1, but now the space below the 1 is filled with the black bar, and is no longer blank. The other posts I consulted deal with cases when the y axis starts at 0 so expand_scale() did the job. Not in my case.   </p>
  
  <p>Any idea on how to resolve this issue?  </p>