diff options
author | Gard Spreemann <gspr@nonempty.org> | 2023-06-08 11:52:00 +0200 |
---|---|---|
committer | Gard Spreemann <gspr@nonempty.org> | 2023-06-08 11:52:00 +0200 |
commit | 63870a2e60c1bc8bfa7e3672457b551a8e51ffaf (patch) | |
tree | fe2c0cd5f62e3fbd17e58d3903ec6bb37983f620 /scripts/benchmark/plot.py | |
parent | d31fb141cb597aaf405674621aa25f263aa375e1 (diff) | |
parent | b0b302889cc786907efb080c4e1beea30d2fa39f (diff) |
Merge tag '1.6.0' into gspr/post-bookworm
Diffstat (limited to 'scripts/benchmark/plot.py')
-rw-r--r-- | scripts/benchmark/plot.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/scripts/benchmark/plot.py b/scripts/benchmark/plot.py index b0b63df3..2cf5d04d 100644 --- a/scripts/benchmark/plot.py +++ b/scripts/benchmark/plot.py @@ -76,7 +76,12 @@ def plot_graphs(results, file_name, num_rows, num_cols, for col in range(num_cols): index = row * num_cols + col result = results[index] - ax = axes[row, col] + if num_rows == 1: + ax = axes[col] + elif num_cols == 1: + ax = axes[row] + else: + ax = axes[row, col] plt.sca(ax) print("[plot] Plotting subplot %d" % index) @@ -90,7 +95,8 @@ def plot_graphs(results, file_name, num_rows, num_cols, x_ticks = [v if not (i % 2) else "" for i, v in enumerate(x_ticks)] # Sets the y-data - y_list = [[r[y_key] if y_key in r.keys() else 0 for r in result] for y_key in y_keys[index]] + y_list = [[r[y_key] if y_key in r.keys() and not isinstance(r[y_key], str) else 0 for r in result] + for y_key in y_keys[index]] y_max = [max(y) if len(y) else 1 for y in y_list] y_max = max(y_max) if len(y_list) > 0 else 1 |