title: Draw a curve from the scatter plot in matplotlib in Python?
body: <p><img src="https://i.stack.imgur.com/l6Bg5.png" alt="enter image description here"></p>
  
  <p><strong>My Question:</strong></p>
  
  <p>How can i draw a curve though this data, thus describing an equation for this plot..</p>
  
  <p>I generated this scatter plot by following code, but I am not able to figure out how to generate an equation for this data and draw the corresponding curve on this plot simultaneously. Please Help.!</p>
  
  <pre><code>def draw(data,xlabel,ylabel):
      print('length of data : ',len(data))
      x,y = [],[]
      for i in data:
          x.append((i[1]))
          y.append((i[0]))
      plt.scatter(x, y,marker=r'o',color='b')
      plt.xlabel(xlabel)
      plt.ylabel(ylabel)
      plt.show()
  </code></pre>
  
  <p>Basically I want something like this:<img src="https://i.stack.imgur.com/sZQsv.png" alt="enter image description here"></p>