title: Matplotlib scatter(): Polynomial regression line
body: <p>Is it possible to do a polynomial regression line on a scatter() in matplotlib? </p>
  
  <p>This is my graph:
  <a href="https://imgur.com/a/Xh1BO" rel="nofollow noreferrer">https://imgur.com/a/Xh1BO</a></p>
  
  <pre><code>    alg_n = [1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4...]
      orig_hc_runtime = [0.01, 0.02, 0.03, 0.04, 0.04, 0.04, 0.05, 0.09...]
  
      plt.scatter(alg_n, orig_hc_runtime, label="Orig HC", color="b", s=4)
      plt.scatter(alg_n, mod_hc_runtime, label="Mod HC", color="c", s=4)
      ...
  
      x_values = [x for x in range(5, n_init+2, 2)]
      y_values = [y for y in range(0, 10, 2)]
  
      plt.xlabel("Number of Queens")
      plt.ylabel("Time (sec)")
      plt.title("Algorithm Performance: Time")
      plt.xticks(x_values)
      plt.yticks(y_values)
      plt.grid(linewidth="1", color="white")
      plt.legend()
      plt.show()
  </code></pre>
  
  <p>Is it possible to have regression lines for eat data set? If so, can you please explain how I can do it. </p>