title: What do the arguments passed inside the plt.plot() method mean?
body: <p>I was trying to plot a linear regression model in python using scikit learn and matplotlib. However, the code got confusing when I was plotting the data using plt.scatter() and plt.plot()</p>
  
  <p>Here's my code which models the data using sklearn:-</p>
  
  <pre><code>from sklearn import linear_model
  regr = linear_model.LinearRegression()
  train_x = np.asanyarray(train[['ENGINESIZE']])
  train_y = np.asanyarray(train[['CO2EMISSIONS']])
  regr.fit (train_x, train_y)
  # The coefficients
  print ('Coefficients: ', regr.coef_)
  print ('Intercept: ',regr.intercept_)
  </code></pre>
  
  <p>Here's my code which plots the linear regression model on a graph:-</p>
  
  <pre><code>plt.scatter(train.ENGINESIZE, train.CO2EMISSIONS,  color='blue')
  plt.plot(train_x, regr.coef_[0][0]*train_x + regr.intercept_[0], '-y')
  plt.xlabel("Engine size")
  plt.ylabel("Emission")
  </code></pre>
  
  <p>I don't understand the arguments passed in <code>plt.scatter()</code> and <code>plt.plot()</code>. I noticed that when I remove the method <code>plt.plot()</code>, the line of best fit is not plotted on the graph. </p>