-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplottest.py
More file actions
149 lines (112 loc) · 2.59 KB
/
plottest.py
File metadata and controls
149 lines (112 loc) · 2.59 KB
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
import pylab
import scipy
##print('simple')
##pylab.plot([1,2,3],[1,2,3])
##pylab.show()
##
##
##print('double')
### pylab.plot([1,2,3],[[2,3,4],[1,2,3]]) # wrong dimensions!
##pylab.plot([1,2,3],[[1,2],[2,3],[3,4]])
##pylab.show()
##
##print('double dots')
##pylab.plot([1,2,3],[[1,2],[2,3],[3,4]], 'b.')
##pylab.show()
##
##print('array')
##test=[[1,2],[2,3],[3,4]]
##testArray=scipy.array(test)
##pylab.plot([1,2,3],testArray)
##pylab.show()
##
##print(testArray.shape)
##
##
##test1=[1,2,3]
##test2=[2,3,4]
##
##print('array created differently')
##test=[]
##test.append(test1)
##test.append(test2)
##testArray=scipy.array(test)
##print(testArray.shape)
##testArray=scipy.transpose(testArray)
##print(testArray.shape)
##pylab.plot([1,2,3],testArray)
##pylab.show()
##x=[1,2,3,4,5]
##yr=[2,4,6,7,8]
##yc=[1,2,2,2,5]
##yg=[1,3,4,6,1]
##
##pylab.bar(x, yr, color='#88aa33', align='center', label='histogram')
##pylab.plot(x, yc, 'bo-', label='cumulative')
##pylab.plot(x, yg, 'ro-',label='2nd set of cookies')
##pylab.legend()
##pylab.show()
##import matplotlib.pyplot as plt
##fig = plt.figure()
##image1=fig.add_subplot(111)
##t = scipy.arange(0,10,1)
##data1=t*2
##data2*t*3
##
##
##
##
##from pylab import plot, show, ylim, yticks
##import scipy
##
##
##
####.numerix import sin, cos, exp, pi, arange
##
##
##t = scipy.arange(0.0, 2.0, 0.01)
##s1 = t
##s2 = t*2
##s3 = t*3
##s4 = t*4
##
####plot(t, s1, t, s2+1, t, s3+2, t, s4+3, color='k')
##pylab.plot(t, s1, t, s2+1, t, s3+2, t, s4+3)
##ylim(-1,4)
##yticks(scipy.arange(4), ['S1', 'S2', 'S3', 'S4'])
##
##show()
##x=[1,2,3,4,5]
##yr=[2,4,6,7,8]
##yc=[1,2,2,2,5]
##yg=[1,3,4,6,1]
##
##pylab.figure()
##pylab.title('BIG MOTHAH ...')
##pylab.bar(x, yr, color='#88aa33', align='center', label='histogram') # completely ignored!!! subplots are wonderful!
##pylab.subplot(1,2,1)
##pylab.title('test1')
##pylab.plot(x, yc, 'bo-')
##pylab.subplot(1,2,2)
##pylab.title('test2')
##pylab.plot(x, yg, 'ro-')
##pylab.legend()
##pylab.show()
import matplotlib.pyplot as plt
import numpy as np
x,y = np.random.randn(2,100)
fig = plt.figure()
fig.subplots_adjust(left=0.25, bottom=0.25)
##axtitle=fig.add_axes([0.8, 0.025, 0.1, 0.04])
axtitle=fig.text(0.5,0.5,'lalalalalala')
ax1 = fig.add_subplot(211)
plt.ylim(1)
ax1.xcorr(x, y, usevlines=True, maxlags=50, normed=True, lw=2)
ax1.grid(True)
ax1.axhline(0, color='black', lw=2)
ax2 = fig.add_subplot(212, sharex=ax1)
ax2.acorr(x, usevlines=True, normed=True, maxlags=50, lw=2)
ax2.grid(True)
ax2.axhline(0, color='black', lw=2)
##fig.show() # looks nicer from a coding perspective... but crashes ... ... so fuck it!
plt.show()