Index: benchmark/plot.py
===================================================================
--- benchmark/plot.py	(revision c9136d9212f630a29246439b86bd3464274fc325)
+++ benchmark/plot.py	(revision 57af3f3fae95ef06a0cafe16bfd0bfa6e8f9cf62)
@@ -15,4 +15,5 @@
 import numpy
 import re
+import statistics
 import sys
 
@@ -40,18 +41,49 @@
 }
 
-def plot(data, x, y, out):
+def plot(in_data, x, y, out):
 	fig, ax = plt.subplots()
 	colors = itertools.cycle(['#0095e3','#006cb4','#69df00','#0aa000','#fb0300','#e30002','#fd8f00','#ff7f00','#8f00d6','#4b009a','#ffff00','#b13f00'])
-	series = {}
-	for entry in data:
-		if not entry[0] in series:
-			series[entry[0]] = {'x':[], 'y':[]}
+	series = {} # scatter data for each individual data point
+	groups = {} # data points for x value
+	for entry in in_data:
+		name = entry[0]
+		if not name in series:
+			series[name] = {'x':[], 'y':[]}
+
+		if not name in groups:
+			groups[name] = {}
 
 		if x in entry[2] and y in entry[2]:
-			series[entry[0]]['x'].append(entry[2][x])
-			series[entry[0]]['y'].append(entry[2][y])
+			xval = entry[2][x]
+			yval = entry[2][y]
+			series[name]['x'].append(xval)
+			series[name]['y'].append(yval)
+
+			if not xval in groups[name]:
+				groups[name][xval] = []
+
+			groups[name][xval].append(yval)
+
+	lines = {} # lines from groups with min, max, median, etc.
+	for name, data in groups.items():
+		if not name in lines:
+			lines[name] = { 'x': [], 'min':[], 'max':[], 'med':[], 'avg':[] }
+
+		for xkey in sorted(data):
+			ys = data[xkey]
+			lines[name]['x']  .append(xkey)
+			lines[name]['min'].append(min(ys))
+			lines[name]['max'].append(max(ys))
+			lines[name]['med'].append(statistics.median(ys))
+			lines[name]['avg'].append(statistics.mean(ys))
+
+		print(lines[name])
 
 	for name, data in series.items():
-		plt.scatter(data['x'], data['y'], color=next(colors), label=name, marker='x')
+		_col = next(colors)
+		plt.scatter(data['x'], data['y'], color=_col, label=name, marker='x')
+		plt.plot(lines[name]['x'], lines[name]['min'], '--', color=_col)
+		plt.plot(lines[name]['x'], lines[name]['max'], '--', color=_col)
+		plt.plot(lines[name]['x'], lines[name]['med'], '-', color=_col)
 
 	mx = max([max(s['x']) for s in series.values()])
