Menu

[r319]: / trunk / htdocs / examples / test.py  Maximize  Restore  History

Download this file

30 lines (25 with data), 865 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env python
import sys
from matplotlib.matlab import *
from data_helper import get_daily_data
fig = figure(1,frameon=False)
intc, msft = get_daily_data()
delta1 = diff(intc.open)/intc.open[0]
volume = (10*intc.volume[:-2]/intc.volume[0])**2
close = 0.003*intc.close[:-2]/0.003*intc.open[:-2]
p = scatter(delta1[:-1], delta1[1:], c=close, s=volume)
set(p, 'alpha', 0.75)
set(gca(), 'xticks', arange(-0.06, 0.061, 0.02))
set(gca(), 'yticks', arange(-0.06, 0.061, 0.02))
xlabel(r'$\Delta_i$', fontsize='x-large')
ylabel(r'$\Delta_{i+1}$', fontsize='x-large',
verticalalignment='center',
horizontalalignment='right',
rotation='horizontal'
)
title(r'Volume and percent change')
grid(True)
gca().set_frame_on(0)
fig._figurePatch.set_alpha(0.0) # doesn't affect output
savefig('scatter_demo3',facecolor='b',edgecolor='g')
#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.