summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCedric Nugteren <web@cedricnugteren.nl>2022-10-13 22:24:35 +0200
committerCedric Nugteren <web@cedricnugteren.nl>2022-10-13 22:24:35 +0200
commit374eba3ee22f5ee3866420afbe31d8a71a47bc9a (patch)
treebc7daf813d8d7c34bbeaa7f2ebcd83e82e1be259
parent8aa9f32b2326e2c54ed697442378d4c8b7415b11 (diff)
Fix plotting issue with a single row or column
-rw-r--r--scripts/benchmark/plot.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/benchmark/plot.py b/scripts/benchmark/plot.py
index c36f476f..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)