Menu

[r3358]: / trunk / htdocs / examples / stock_demo.py  Maximize  Restore  History

Download this file

20 lines (15 with data), 411 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env python
from matplotlib.ticker import MultipleLocator
from pylab import *
from data_helper import get_two_stock_data
d1, p1, d2, p2 = get_two_stock_data()
ax = subplot(111)
lines = plot(d1, p1, 'bs', d2, p2, 'go')
xlabel('Days')
ylabel('Normalized price')
xlim(0, 3)
ax.xaxis.set_major_locator(MultipleLocator(1))
title('INTC vs AAPL')
legend( ('INTC', 'AAPL') )
#savefig('stock_demo')
show()
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.