title: How to plot the difference between data and a function in matplotlib
body: <p>I have a data set of x,y values in a file called values.txt like so:</p>
  
  <pre><code>1  32432.4323
  2  23432.1143
  .
  .
  .
  999 1111.23432
  </code></pre>
  
  <p>I also have a function f(x), 2*x^2+1</p>
  
  <p>I'd like to plot the difference curve between the function and the y values. Something like this:</p>
  
  <pre><code>1  32432.4323 - f(1)
  2  23432.1143 - f(2)
  .
  .
  .
  999 1111.23432 - f(999)
  </code></pre>
  
  <p>I can do it by calculating the difference and placing into a separate file values_diff.txt and loading that into matplotlib, but I was wondering if there was a more idiomatic way of doing this in matplotlib that doesn't require the explicit use of a second file,</p>