-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrsme_plot.py
32 lines (22 loc) · 851 Bytes
/
rsme_plot.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
import argparse
import matplotlib.pyplot as plt
def main():
parser = argparse.ArgumentParser()
parser.add_argument("--data-path", type=str, required=True)
parser.add_argument("--fig-size", nargs="+", type=int, default=(2, 2))
args = parser.parse_args()
# figure creation
fig, ax = plt.subplots(figsize=args.fig_size)
with open(args.data_path) as f:
line_list = f.read().splitlines()
x = [float(n) for n in line_list[1].split(",")]
y = [float(n) for n in line_list[0].split(",")]
ax.scatter(x, y)
for i in range(2, len(line_list), 2):
x = [float(n) for n in line_list[i + 1].split(",")]
y = [float(n) for n in line_list[i].split(",")]
ax.plot(x, y)
plt.tight_layout()
plt.savefig("rsme.pdf")
if __name__ == "__main__":
main()