title: Overlay a line function on a scatter plot - seaborn
body: <p>My challenge is to overlay a custom line function graph over a scatter plot I already have, the code looks like follows:  </p>
  
  <pre><code>base_beta = results.params
  X_plot = np.linspace(0,1,400)
  
  g = sns.FacetGrid(data, size = 6)
  g = g.map(plt.scatter, "usable_area", "price", edgecolor="w")
  </code></pre>
  
  <p>Where <code>base_beta</code> is only a constant, and then one coefficient. Basically, I want to overlay a function that plots a line <code>y = constant + coefficient * x</code>  </p>
  
  <p>I tried to overlay a line using this but it did not work.</p>
  
  <pre><code>g = g.map_dataframe(plt.plot, X_plot, X_plot*base_beta[1]+base_beta[0], 'r-')
  plt.show()
  </code></pre>
  
  <p>The current scatter plot looks like so:<br>
  <a href="https://i.stack.imgur.com/5yXdR.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5yXdR.jpg" alt="enter image description here"></a></p>
  
  <p>Can any one help me with this?</p>
  
  <p>--ATTEMPT 1</p>
  
  <pre><code>base_beta = results.params
  X_plot = np.linspace(0,1,400)
  Y_plot = base_beta [0] + base_beta[1]*X_plot
  
  g = sns.FacetGrid(data, size = 6)
  g = g.map(plt.scatter, "usable_area", "price", edgecolor="w")
  plt.plot(X_plot, Y_plot, color='r')
  plt.show()
  </code></pre>
  
  <p>Resulted in the same graph but no line:
  <a href="https://i.stack.imgur.com/h1CY1.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/h1CY1.jpg" alt="enter image description here"></a></p>