title: Interpolating correctly between points in R using ggplot2 and axis scaling
body: <p>I have some data I want to graph on a semi-log scale, however I get some artifacts when there is a large jump between points. On linear scale, a straight line is drawn between subsequent points, which is a fine approximation for visualization. However, the exact same thing is done when using the log scale (either by using scale_x_log10 or scale_x_continuous with a log transformation). A line between two points on the semi-log scale should show up curved. In other words, this:</p>
  
  <pre><code>df &lt;- data.frame(x = c(0, 1), y = c(0, 1))
  ggplot(data = df, aes(x, y)) + geom_line() + scale_x_log10(limits = c(10^-3, 10^0))
  </code></pre>
  
  <p>produces this:</p>
  
  <p><img src="https://i.stack.imgur.com/lYD7V.png" alt="enter image description here"></p>
  
  <p>when I would expect something more like this:</p>
  
  <p><img src="https://i.stack.imgur.com/Xyk1j.png" alt="enter image description here"></p>
  
  <p>generated by this code:</p>
  
  <pre><code>df &lt;- data.frame(x = seq(0, 1, 0.01), y = seq(0, 1, 0.01))
  ggplot(data = df, aes(x, y)) + geom_line() + scale_x_log10(limits = c(10^-3, 10^0))
  </code></pre>
  
  <p>It's clear what's happening, but I'm not sure what the best way to fix the interpolation is. In the actual data I'm plotting there are a few jumps at various points, which makes the plots very misleading when trying to compare two lines. (They're ROC curves in this instance.)</p>
  
  <p>One thought is I can search the data for jumps and fill in some interpolated points myself, but I'm hoping for a cleaner way that doesn't involve me adding in a bunch of fake data points.</p>