title: Plot a true linear relationship on a log axis with ggplot2
body: <p>Is there a way to plot the line for a linear relationship (or several linear relationships), where one axis has a log scale, and for the line to show the true linear relationship (i.e. not a straight line on the actual plot), as below?</p>
  
  <p><a href="https://i.stack.imgur.com/kYlMb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kYlMb.png" alt="excel mockup"></a></p>
  
  <p>The following code plots what appears on the plot as a straight line, but because the y-axis is a log scale it doesn't plot a true linear relationship.</p>
  
  <pre><code>ggplot(df.m, aes(x, value, colour = variable)) +
    geom_point(alpha = .5, shape = 20) +
    xlab('Index of Multiple Deprivation (2015)') +
    ylab('Average network distance to nearest 2ha+ greenspace (m)') +
    scale_y_log10() +
    geom_smooth(method=lm, se = FALSE)
  </code></pre>
  
  <p>It produces the following plot:</p>
  
  <p><a href="https://i.stack.imgur.com/rTCs9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rTCs9.png" alt="ggplot version"></a></p>
  
  <p>EDIT: reproducible example</p>
  
  <pre><code>ggplot(diamonds[1:5000, ],  aes(x = carat, y = price, colour = cut)) +
    geom_point(alpha = .5, shape = 20) +
    xlim(0.5, 1.5) +
    scale_y_log10(breaks = c(2500, 3000, 3500, 4000), limits = c(2500, 4000)) +
    geom_smooth(method=lm, se = FALSE)
  </code></pre>
  
  <p>Produces the following plot:</p>
  
  <p><a href="https://i.stack.imgur.com/Hak1D.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Hak1D.png" alt="reproducible diamonds example"></a></p>
  
  <p>As you can see, although the y-axis has a log scale, the lines are still <em>literally</em> straight lines.</p>