Skip to content
Carlos edited this page Feb 3, 2014 · 1 revision

Optionally, if you have matplotlib, plotting the data retrieved by YahooData is very easy. Here there is an example:

from stockwrapper import YahooData
import pylab

data = YahooData()

mystock = 'FRAN.BA'

hist = data.get_historical(mystock)

dates = [item['Date'] for item in hist]
close = [item['Close'] for item in hist]

ndates = pylab.datestr2num(dates)

pylab.plot_date(ndates, close)
pylab.title(mystock + " historical prices")
pylab.ylabel("Price")
pylab.grid(True)
pylab.show()

This is the output of this simple example:

Output of the example

Clone this wiki locally