title: Function to plot stock price - why are they plotting together and not individually?
body: <p>I am trying to automate graphing the stock price and its moving averages. I have a list of stocks, I would like to create a chart with the stock's price, its 50 day moving average, and its 200 day moving average. I want to do this for x number of stocks in my list. When I run it, why are they plotting over top of each other on the same graph, rather than individually?    </p>
  
  <pre><code>import pandas as pd
  from pandas import DataFrame
  from matplotlib import pyplot as plt
  import pandas.io.data as web
  import datetime as dt
  
  stocks = ['AAPL', 'DVN', 'XOM']
  start = '2010-01-01'
  end = dt.datetime.today()
  
  def plotStock(stock):
      df = web.DataReader(stock, 'yahoo', start, end)['Adj Close']
      df.plot()
      pd.rolling_mean(df, 50).plot(style='k')
      pd.rolling_mean(df, 200).plot(style='--')
      plt.title(stock, fontsize=10)
      plt.savefig(stock + '.png', bbox_inches='tight')
  
  for stock in stocks:
      plotStock(stock)
  </code></pre>