Menu

[r134]: / trunk / htdocs / examples / scatter_demo2.py  Maximize  Restore  History

Download this file

21 lines (15 with data), 531 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
import sys
from matplotlib.matlab import *
from data_helper import get_daily_data
intc, msft = get_daily_data()
delta1 = diff(intc.open)/intc.open[0]
volume = 0.003*intc.volume[:-2]/intc.volume[0]
close = 0.003*intc.close[:-2]/0.003*intc.open[:-2]
scatter(delta1[:-1], delta1[1:], c=close, s=volume)
set(gca(), 'xticks', arange(-0.06, 0.061, 0.02))
set(gca(), 'yticks', arange(-0.06, 0.061, 0.02))
xlabel('Delta day i')
ylabel('Delta day i+1')
title('Delta price as a function of volume and percent change')
grid(True)
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.