title: How to plot a graph of actual vs predict values in python?
body: <pre><code>          Original      Predicted
  0           6            1.56
  1           12.2         3.07
  2           0.8          2.78
  3           5.2          3.54
  .                    
  </code></pre>
  <p>Code that I have tried:</p>
  <pre><code>def plotGraph(y_test,y_pred,regressorName):
      if max(y_test) &gt;= max(y_pred):
          my_range = int(max(y_test))
      else:
          my_range = int(max(y_pred))
      plt.scatter(y_test, y_pred, color='red')
      plt.plot(range(my_range), range(my_range), 'o')
      plt.title(regressorName)
      plt.show()
      return
  </code></pre>
  <p>Graph that I just wanted:
  <a href="https://i.stack.imgur.com/9D5YF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9D5YF.png" alt="enter image description here" /></a></p>
  <p>But my current output:</p>
  <p><a href="https://i.stack.imgur.com/fMT0O.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fMT0O.png" alt="enter image description here" /></a></p>