diff options
author | David Robillard <d@drobilla.net> | 2011-09-19 03:20:05 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-09-19 03:20:05 +0000 |
commit | 2b6c9941272b53c978d418c63669e52e39d9fe4a (patch) | |
tree | 14f7e5aa69205a57142fce0712a72b7e7e830cd9 /plot.py | |
parent | 6cd39f7513775d2ac0137bfbae74aadf10241bb0 (diff) | |
download | zix-2b6c9941272b53c978d418c63669e52e39d9fe4a.tar.gz zix-2b6c9941272b53c978d418c63669e52e39d9fe4a.tar.bz2 zix-2b6c9941272b53c978d418c63669e52e39d9fe4a.zip |
Add ZixPatree.
git-svn-id: http://svn.drobilla.net/zix/trunk@21 df6676b4-ccc9-40e5-b5d6-7c4628a128e3
Diffstat (limited to 'plot.py')
-rwxr-xr-x | plot.py | 29 |
1 files changed, 20 insertions, 9 deletions
@@ -14,13 +14,18 @@ for i in range(n_plots): filename = sys.argv[i+1] file = open(filename, 'r') - math.ceil + header = file.readline() + columns = header[1:].split() + pyplot.subplot(math.ceil(math.sqrt(n_plots)), math.ceil(math.sqrt(n_plots)), i + 1) pyplot.xlabel('# Elements') pyplot.ylabel('Time (s)') + times = [] + for i in columns: + times.append([]) ns = [] zix_tree_times = [] zix_sorted_array_times = [] @@ -28,16 +33,22 @@ for i in range(n_plots): for line in file: if line[0] == '#': continue; - (n, zix_tree, zix_sorted_array, glib) = line.split() - ns.append(int(n)) - zix_tree_times.append(float(zix_tree)) - zix_sorted_array_times.append(float(zix_sorted_array)) - glib_times.append(float(glib)) + #(n, zix_tree, zix_sorted_array, glib) = line.split() + fields = line.split() + num = 0 + for i in fields: + times[num].append([float(i)]) + num += 1 + + #ns.append(int(n)) + #zix_tree_times.append(float(zix_tree)) + #zix_sorted_array_times.append(float(zix_sorted_array)) + #glib_times.append(float(glib)) file.close() - matplotlib.pyplot.plot(ns, zix_tree_times, '-o', label='ZixTree') - matplotlib.pyplot.plot(ns, zix_sorted_array_times, '-o', label='ZixSortedArray') - matplotlib.pyplot.plot(ns, glib_times, '-x', label='GSequence') + for i in range(len(times) - 1): + matplotlib.pyplot.plot(times[0], times[i + 1], '-o', label=columns[i + 1]) + pyplot.legend(loc='upper left') pyplot.title(os.path.splitext(os.path.basename(filename))[0].title()) |