-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot.py
More file actions
executable file
·39 lines (29 loc) · 778 Bytes
/
plot.py
File metadata and controls
executable file
·39 lines (29 loc) · 778 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
30
31
32
33
34
35
36
37
38
39
#!/bin/python3 -u
import matplotlib.pyplot as plt
## read line by line from stdin
def read_lines():
while True:
line = input()
splits = line.split()
## read_batch
## whole_ring
## windowed__
# if splits[0] == "read_batch":
# if splits[0] == "whole_ring":
# if splits[0] == "windowed__":
labl = splits[0]
if labl == "whole_ring" or labl == "windowed__":
plot_line(line)
def plot_line(line):
splits = line.split()
labl = splits[0] + splits[1]
xs = [float(x) for x in splits[2:]]
plot_array(xs, labl)
plt.show()
def plot_array(xs, labl):
plt.plot(xs)
plt.xlabel('Index')
plt.ylabel('Value')
plt.title(labl)
plt.grid(True)
read_lines()