-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathplot.py
More file actions
32 lines (24 loc) · 696 Bytes
/
plot.py
File metadata and controls
32 lines (24 loc) · 696 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
import matplotlib.pyplot
def main():
dpi = 96
win_width = 800
win_height = 400
figure = matplotlib.pyplot.figure(figsize=(win_width / dpi, win_height / dpi))
axes = figure.add_axes((0.1, 0.15, 0.8, 0.7))
axes.spines[["top", "bottom", "left", "right"]].set_visible(True)
f = open("plot.txt", "r")
x = []
y_m = []
y_a = []
for line in f:
a, b, c = line.split()
x.append(float(a))
y_m.append(float(b))
y_a.append(float(c))
axes.plot(x, y_m)
axes.plot(x, y_a)
axes.grid(which="minor", alpha=0.35)
axes.grid(which="major", alpha=0.7)
matplotlib.pyplot.show()
if __name__ == "__main__":
main()