-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplot_err.py
63 lines (53 loc) · 1.18 KB
/
plot_err.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import matplotlib.pyplot as plt
import numpy as np
# k = 5
# Input length
# 363
# 1349
# 90186
# "progs/err-eval-medium.gcl"
# Input length
# 3658
# 14262
# 105772
# "progs/err-eval-longest.gcl"
# Input length
# 17661
# 90567
# 151389
accu = [1.35, 14.26, 90.57]
atto = [90.19, 105.77, 151.39]
# k = 1
# "progs/err-eval.gcl"
# Input length
# 363
# 2184
# 90186
# "progs/err-eval-medium.gcl"
# Input length
# 3658
# 15175
# 105772
# "progs/err-eval-longest.gcl"
# Input length
# 17661
# 91678
# 151389
# accu = [2.18, 15.18, 91.68]
# atto = [90.19, 105.77, 151.39]
lengths = ["363", "3658", "17661"]
width = 1 / len(accu)
(fig, ax) = plt.subplots(layout="constrained", figsize=(6.4, 4.8), dpi=150)
indices = np.arange(len(lengths))
ax.bar(indices - width/2, accu, width, label='accuparsec')
ax.bar(indices + width/2, atto, width, label='attoparsec')
ax.set_xticks(indices)
ax.set_xticklabels(lengths)
for i in range(len(accu)):
plt.text(i - width/2, accu[i]+1, accu[i], ha='center')
plt.text(i + width/2, atto[i]+1, atto[i], ha='center')
ax.set_ylabel("Average distance from error")
ax.set_xlabel("Input size (characters)", usetex=False)
ax.legend()
fig.savefig("plot/err.png")
# fig.show()