-
Notifications
You must be signed in to change notification settings - Fork 1
/
graph.py
74 lines (59 loc) · 1.61 KB
/
graph.py
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import pylab as plt
import numpy as np
import multiples
test = multiples.multiples("AAPL")
test.add("MSFT")
test.add("JNJ")
test.add("WFC")
test.add("JPM")
test.add("PG")
test.printPElist()
multipleList = test.PElist;
print multipleList
# fake up some data
'''
spread= rand(50) * 100
print spread
center = ones(25) * 50
print center
flier_high = rand(10) * 100 + 100
print flier_high
flier_low = rand(10) * -100
print flier_low
data =(spread, center, flier_high, flier_low)
'''
def makeBoxPlot(company):
boxes = []
totalFigs = 3
graphablePElist = []
for i in company.PElist:
graphablePElist.append(i[1])
graphablePEGlist = []
for i in company.PEGlist:
graphablePEGlist.append(i[1])
graphablePriceBookList = []
for i in company.PriceBookList:
graphablePriceBookList.append(i[1])
boxes.append(graphablePElist)
boxes.append(graphablePEGlist)
boxes.append(graphablePriceBookList)
plt.figure()
plt.hold = True
print graphablePElist
plt.boxplot(boxes, vert = 0)
plt.title('Equity Value Multiples')
plt.text(13, 3.2, "Price to Book ", bbox=dict(facecolor='red', alpha=0.5))
plt.text(13, 2.2, "PEG ratio ", bbox=dict(facecolor='red', alpha=0.5))
plt.text(13, 1.3, "PE ratio ", bbox=dict(facecolor='red', alpha=0.5))
plt.show()
'''
for i in np.arange(totfigs):
x = np.random.random(50)
#plt.subplot('{0}{1}{2}'.format(totfigs,1,i+1))
plt.boxplot(x,vert=0)
'''
'''
plt.boxplot(x,vert=0)
plt.show()
'''
makeBoxPlot(test)