title: How to plot line (polygonal chain) with numpy/scipy/matplotlib with minimal smoothing
body: <p>I am trying to plot a line in matplotlib.. I am searching for the right type of interpolation.. I want something like this</p>
  
  <p><img src="https://i.stack.imgur.com/gIAd2.png" alt="taken from canvasxpress.org/line.html"></p>
  
  <p>where every line is smoothed. I tried several combination of scipy and matplotlib, such as</p>
  
  <pre><code>x_new = np.arange(x, x_length, 1)
  tck = interpolate.splrep(x, y, s=3)
  y_new = interpolate.splev(x_new, tck, der=0)
  ax.plot(x_new, y_new, color+lstyle)
  </code></pre>
  
  <p>but the best result I get is</p>
  
  <p><img src="https://i.stack.imgur.com/cKSP5.png" alt="my result"></p>
  
  <p>The line represents <strong>an increasing variable</strong>.. so it is a wrong representation. What can I search for?</p>
  
  <p>Thanks</p>
  
  <p>Edit: I am thinking about implementing a method from myself, but I don't know if it has been already done.. pseudo code is the following</p>
  
  <pre><code>take x and y
  calculate spline for each three points 
  x[0], x[1], x[2] ... x[1], x[2], x[3] ... and so on
  for each y[n] sums every computation done for it and divide by number of 
  computations (i.e. y[1] is computed for triplette x[0..2] and x[1..3] so the 
  sum is divided by two (average for each point is taken as its value)
  </code></pre>