ValueError: Invalid chart type given scatter
<p>I am new to Python and I am trying to plot a simple scatter plot for 2 stocks (Adj Close). For some reason I am unable to generate a scatter plot (when I remove the <code>kind='scatter'</code> argument, the chart runs as expected, but is a line chart). Here is my code:</p>

<pre><code>from pandas.io.data import DataReader
from datetime import datetime
import matplotlib.pyplot as plt

#inputs
symbols   = ['SPY', 'QQQ']
startDate = datetime(2013,1,1)
endDate   = datetime(2016,12,31)

#get data from yahoo
instrument = DataReader(symbols, 'yahoo', startDate, endDate)
#isolate column
close = instrument['Adj Close']

def compute_daily_returns(df):
    daily_returns = (df / df.shift(1)) - 1
    return daily_returns

dlyRtns = compute_daily_returns(close)
xPlt = dlyRtns['SPY']
yPlt = dlyRtns['QQQ']

dlyRtns.plot(kind='scatter', x=xPlt, y=yPlt)
plt.show()
</code></pre>

<p>and here is the resulting error message (any ideas on what I am missing?):</p>

<blockquote>
  <p>Traceback (most recent call last):
    File "C:/Users/sferrom/PycharmProjects/untitled2/scatterPlot.py", line 27, in 
      dlyRtns.plot(kind='scatter', x=xPlt, y=yPlt)
    File "C:\Python27\lib\site-packages\pandas\tools\plotting.py", line 1537, in plot_frame
      raise ValueError('Invalid chart type given %s' % kind)
  ValueError: Invalid chart type given scatter</p>
</blockquote>

<p>Process finished with exit code 1</p>

<p>"Create" <code>scatter</code> plot from <code>line</code> chart if <code>line</code> works:</p>

<pre><code>dlyRtns.plot(x=xPlt, y=yPlt, marker='o', linewidth=0)
</code></pre>

python python-2.7 pandas matplotlib plot