forked from mbezaire/BG_Girard_etal_2008
-
Notifications
You must be signed in to change notification settings - Fork 4
/
plotresults.py
36 lines (30 loc) · 1.02 KB
/
plotresults.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
import matplotlib.pyplot as plt
import pandas
#=========================================
def plotnow(simname = None, NbChannels=6):
#=========================================
if not simname:
titleadd=""
simadd = ''
else:
titleadd=simname
simadd = titleadd + '_'
labels=["D1","D2","STN","GPe","GPi"]
# with open('log\\' + simadd + 'BG_customCBG', 'rt') as theFile: #windows
with open('log/' + simadd + 'BG_customCBG', 'rt') as theFile: # linux or mac
reader = pandas.read_csv(theFile, sep=' ', header=None)
fig = plt.figure()
plt.plot(range(reader.shape[0]),reader[:][0])
plt.xlabel('Time Step')
plt.ylabel('FS Cell Response')
plt.title(titleadd)
for i in range(1,reader.shape[1]):
if (i-1)%NbChannels==0:
fig = plt.figure()
plt.plot(range(reader.shape[0]),reader[:][i],label='Channel #'+ str((i-1)%NbChannels +1))
if i%NbChannels==0 or i==(reader.shape[1]-1):
plt.xlabel('Time Step')
plt.ylabel(labels[int((i-1)/NbChannels)] + ' Cell Response')
plt.legend()
plt.title(titleadd)
plt.show()