Skip to content

Commit 37d786b

Browse files
committed
Add dash line grid and zorder
1 parent fedd90a commit 37d786b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tests/benchmark_plot.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,26 +43,27 @@ def order_kinds(kinds):
4343

4444
def test_plot(test):
4545
ax = plt.gca()
46+
ax.grid(linestyle='dashed', linewidth=0.5)
4647
cmap = matplotlib.cm.get_cmap('Set1')
4748
colors = list(cmap.colors)
4849
colors[0], colors[1] = colors[1], colors[0]
4950
del colors[5]
5051
ax.set_prop_cycle('color', colors)
5152
kinds = args.kind or list(data[test])
52-
for kind in kinds:
53-
kind_plot(test, kind)
53+
for order, kind in enumerate(kinds):
54+
kind_plot(test, kind, len(kinds) - order)
5455
plt.ylim(ymin=9e-7)
5556
plt.loglog()
5657
plt.title(args.name + ' Performance: ' + test)
5758
plt.ylabel('Seconds')
5859
plt.xlabel('List Size')
5960
plt.legend(kinds, loc=2)
6061

61-
def kind_plot(test, kind):
62+
def kind_plot(test, kind, zorder):
6263
sizes = sorted(data[test][kind].keys())
6364
# Timer isn't any better than micro-second resolution.
6465
yvalues = [max(1e-6, data[test][kind][size][5]) for size in sizes]
65-
plt.plot(sizes, yvalues, marker='s')
66+
plt.plot(sizes, yvalues, marker='s', zorder=zorder)
6667

6768
if __name__ == '__main__':
6869
parser = argparse.ArgumentParser(description='Plotting')

0 commit comments

Comments
 (0)