title: How to take draw an average line for a scatter plot
body: <p>My data is the following:</p>
  
  <pre><code>x = [3,4,5,6,7,8,9,9]
  y = [6,5,4,3,2,1,1,2]
  </code></pre>
  
  <p>And I can obtain the following two graphs. </p>
  
  <p><img src="https://i.stack.imgur.com/VdzYL.png" alt="enter image description here"></p>
  
  <p>and</p>
  
  <p><img src="https://i.stack.imgur.com/lmSqJ.png" alt="enter image description here"></p>
  
  <p>However, what I want is <em>this</em> (an average of all the points along the way):
  <img src="https://i.stack.imgur.com/RmGaX.png" alt="enter image description here"></p>
  
  <p>Is it possible in matplotlib? Or do I have to change the list manually and somehow create:</p>
  
  <pre><code>x = [3,4,5,6,7,8,9]
  y = [6,5,4,3,2,1,1.5]
  </code></pre>
  
  <p><strong>RELEVANT CODE</strong></p>
  
  <pre><code>ax.plot(x, y, 'o-', label='curPerform')
  x1,x2,y1,y2 = ax.axis()
  x1 = min(x) - 1 
  x2 = max(x) + 1
  ax.axis((x1,x2,(y1-1),(y2+1)))
  </code></pre>