title: Iterate through linear regression while outputting plots In Python (SciPy & MatPlotLib)
body: <p>Trying to iterate through a for loop which runs 3 regressions over a pandas dataframe while printing a plot of the line for each variable. </p>
  
  <pre><code>year = crime_df.iloc[:,0]
  violent_crime_rate = crime_df.iloc[:,3]
  murder_rate = crime_df.iloc[:,5]
  aggravated_assault_rate = crime_df.iloc[:,11]
  
  
  x_axis = [violentcrimerate, murderrate, aggravatedassaultrate]
  
  
  for x in x_axis:
      slope, intercept, r_value, p_value, std_err = linregress(year, x)
      fit = slope * year + intercept
  
  
      fig, ax = plt.subplots()
  
      fig.suptitle('x', fontsize=16, fontweight="bold")
  
      ax.plot(year, x, linewidth=0, marker='o')
      ax.plot(year, fit, 'b--')
  
  
      plt.show()
  </code></pre>
  
  <p>Code produces 3 plots with title 'x' and distinct regression lines but I would like to know how to set relative titles (and labels) for each plot with respect to each variable within the loop. Unsure how to retrieve the variable names from the list I'm referencing. Tried <code>str(x)</code> in the suptitle line but that returned the values in the column rather than the list title.  </p>