title: Trying to plot a quadratic regression, getting multiple lines
body: <p>I'm making a demonstration of a different types of regression in numpy with ipython, and so far, I've been able to plot a simple linear regression without difficulty.  Now, when I go on to make a quadratic fit to my data and go to plot it, I don't get a quadratic curve but instead get many lines.  Here's the code I'm running that generates the problem:</p>
  
  <pre><code>import numpy
  from numpy import random
  from matplotlib import pyplot as plt
  import math
  
  # Generate random data
  X = random.random((100,1))
  epsilon=random.randn(100,1)
  f = 3+5*X+epsilon
  
  # least squares system
  A =numpy.array([numpy.ones((100,1)),X,X**2])
  A = numpy.squeeze(A)
  A = A.T
  quadfit = numpy.linalg.solve(numpy.dot(A.transpose(),A),numpy.dot(A.transpose(),f))
  
  # plot the data and the fitted parabola
  qdbeta0,qdbeta1,qdbeta2 = quadfit[0][0],quadfit[1][0],quadfit[2][0]
  plt.scatter(X,f)
  plt.plot(X,qdbeta0+qdbeta1*X+qdbeta2*X**2)
  plt.show()
  </code></pre>
  
  <p>What I get is this picture (zoomed in to show the problem):
  <a href="https://i.stack.imgur.com/1emfd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1emfd.png" alt="enter image description here"></a></p>
  
  <p>You can see that rather than having a single parabola that fits the data, I have a huge number of individual lines doing something that I'm not sure of.  Any help would be greatly appreciated.</p>