title: plot this in ggplot. Controlling y axis line within a range
body: <p>This is using base, where I can control the x and y axis range, where exactly the line should be drawn.</p>
  
  <pre><code>plot(mtcars$mpg, mtcars$hp, ylim = c(0, 400), xlim = c(0, 50), axes = F, xlab  = 'mpg', ylab = 'hp', pch = 16)
  axis(side = 2, at = seq(100, 400, 100))
  axis(side = 1, at = seq(10, 30, 10))
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/U2i3m.png" rel="noreferrer"><img src="https://i.stack.imgur.com/U2i3m.png" alt="enter image description here"></a></p>
  
  <pre><code>ggplot(data = mtcars, aes(x = mpg, y = hp))+geom_point()+
  theme(panel.background = element_blank())+
  scale_x_continuous(breaks = seq(10, 30, 10), limits = c(0, 50))+
  scale_y_continuous(breaks = seq(100, 400, 100), limits = c(0, 400))
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/vuGV6.png" rel="noreferrer"><img src="https://i.stack.imgur.com/vuGV6.png" alt="enter image description here"></a></p>
  
  <p>How do I add axis line exactly like base plot ? I have tried <code>scale_y_continuous</code> and <code>scale_x_continuous</code> but it always draws till the end of the plot.</p>