Skip to content

Commit 48cb54f

Browse files
committed
Better titles in plot
1 parent c76e4a4 commit 48cb54f

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

bench/ndarray/concatenate.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def run_numpy_benchmark(num_arrays=10, size=500, axis=0):
112112
return duration, result.shape, data_size_gb
113113

114114

115-
def create_combined_plot(sizes, numpy_speeds_axis0, unaligned_speeds_axis0, aligned_speeds_axis0,
115+
def create_combined_plot(num_arrays, sizes, numpy_speeds_axis0, unaligned_speeds_axis0, aligned_speeds_axis0,
116116
numpy_speeds_axis1, unaligned_speeds_axis1, aligned_speeds_axis1, output_dir="plots"):
117117
"""
118118
Create a figure with two side-by-side bar plots comparing the performance for both axes.
@@ -147,7 +147,7 @@ def create_combined_plot(sizes, numpy_speeds_axis0, unaligned_speeds_axis0, alig
147147
# Add labels and titles
148148
for ax, axis in [(ax0, 0), (ax1, 1)]:
149149
ax.set_xlabel('Array Size (N for NxN array)', fontsize=12)
150-
ax.set_title(f'Concatenation Performance (axis={axis})', fontsize=14)
150+
ax.set_title(f'Concatenation Performance for {num_arrays} arrays (axis={axis})', fontsize=14)
151151
ax.set_xticks(x)
152152
ax.set_xticklabels(x_labels)
153153
ax.grid(True, axis='y', linestyle='--', alpha=0.7)
@@ -198,7 +198,7 @@ def main():
198198
print(f"{'=' * 60}")
199199

200200
# Parameters
201-
sizes = [500, 1000, 2000, 4000] # must be divisible by 4 for aligned chunks
201+
sizes = [500, 1000, 2000, 4000] #, 10000] # must be divisible by 4 for aligned chunks
202202
num_arrays = 10
203203

204204
# Lists to store results for both axes
@@ -260,6 +260,7 @@ def main():
260260

261261
# Create the combined plot with both axes
262262
create_combined_plot(
263+
num_arrays,
263264
sizes,
264265
numpy_speeds_axis0, unaligned_speeds_axis0, aligned_speeds_axis0,
265266
numpy_speeds_axis1, unaligned_speeds_axis1, aligned_speeds_axis1

0 commit comments

Comments
 (0)