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
|
import numpy as np
import matplotlib.pyplot as plt
import seaborn
import matplotlib
seaborn.set_style("white")
matplotlib.rcParams.update({'xtick.labelsize': 12})
matplotlib.rcParams.update({'ytick.labelsize': 12})
matplotlib.rcParams.update({'legend.fontsize': 12})
matplotlib.rcParams.update({'axes.titlesize': 12})
matplotlib.rcParams.update({'axes.labelsize': 12})
with open("time.txt") as fh:
values = [line.split() for line in fh]
h, post, bfs = zip(*values)
plt.plot(h, post, label="DF")
plt.plot(h, bfs, label="BF")
plt.legend()
plt.xlabel("height")
plt.ylabel("runtime (s)")
plt.savefig("time.pdf", bbox_inches='tight')
plt.clf()
with open("misses.txt") as fh:
values = [line.split() for line in fh]
h, bfs, post = zip(*values)
plt.plot(h, post, label="DF")
plt.plot(h, bfs, label="BF")
plt.legend()
plt.xlabel("height")
plt.ylabel("cache-misses")
plt.savefig("misses.pdf", bbox_inches='tight')
print h, post, bfs
|