-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot_multi_data.py
More file actions
57 lines (43 loc) · 1.5 KB
/
plot_multi_data.py
File metadata and controls
57 lines (43 loc) · 1.5 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
#!"C:\Python33\python.exe"
import matplotlib.pyplot as plt
import csv
import argparse
import os
import pandas as pd
from without_building import first_spike
COLORS = ['blue','red','green','orange','purple','grey']
parser = argparse.ArgumentParser(description="retrieve file name")
parser.add_argument("--folder", help="Folder where station data is to be read", required=True)
parser.add_argument("--title", help="Graph title", required=False)
args = parser.parse_args()
nb_stations = 5
# fig,axs = plt.subplots(nb_stations, sharey = True)
data_t = [[] for i in range(nb_stations)]
data_sign = [[] for i in range(nb_stations)]
spikes = []
for index in range(nb_stations):
file_name = os.path.join(args.folder,"STATION_ST" + str(index))
data = open(file_name,'r')
data_reader = csv.reader(data, delimiter=' ')
first = True
for row in data_reader:
if not first:
data_t[index].append(float(row[0]))
data_sign[index].append(float(row[1]))
else:
first = False
data_spike = pd.read_csv(file_name, sep = " ", index_col=False)
spikes.append(first_spike(sensor_data=data_spike))
data.close()
for i in range(nb_stations):
# axs[i].plot(data_t[i],data_sign[i])
plt.plot(data_t[i], data_sign[i], color=COLORS[i])
<<<<<<< HEAD
plt.xlabel("Time (s)")
plt.ylabel("Pression (Pa)")
plt.title()
=======
plt.scatter(spikes[i], 100000, color=COLORS[i])
>>>>>>> Global
plt.show()
# python plot_multi_data.py --folder folder_name