| 142 | plot_1d(filtered_test, sorted_argnames[1], ax, construct_name(sorted_argnames[0], line)) |
| 143 | |
| 144 | def plot_3d(test, sorted_argnames): |
| 145 | assert len(sorted_argnames) == 3 |
| 146 | num_graphs = len(set(test.args[sorted_argnames[0]])) |
| 147 | num_rows = int(math.ceil(math.sqrt(num_graphs))) |
| 148 | num_cols = int(math.ceil(num_graphs / num_rows)) |
| 149 | graphs = set(test.args[sorted_argnames[0]]) |
| 150 | |
| 151 | for j, graph in enumerate(sorted(graphs, key=try_as_numeric)): |
| 152 | ax = plt.subplot(num_rows, num_cols, j + 1) |
| 153 | filtered_test = Test() |
| 154 | indices = range(len(test.times)) |
| 155 | indices = list(filter(lambda i: test.args[sorted_argnames[0]][i] == graph, indices)) |
| 156 | filtered_test.times = [test.times[i] for i in indices] |
| 157 | filtered_test.args[sorted_argnames[1]] = [test.args[sorted_argnames[1]][i] for i in indices] |
| 158 | filtered_test.args[sorted_argnames[2]] = [test.args[sorted_argnames[2]][i] for i in indices] |
| 159 | plot_2d(filtered_test, sorted_argnames[1:], ax, construct_name(sorted_argnames[0], graph)) |
| 160 | |
| 161 | def main(): |
| 162 | if len(sys.argv) != 2: |