|
17 | 17 | workers_main = [item['workers'] for item in data_main]
|
18 | 18 | time_main = [item['time'] for item in data_main]
|
19 | 19 |
|
| 20 | +# Sort the data by workers to ensure correct plotting order |
| 21 | +sorted_pr = sorted(zip(workers_pr, time_pr), key=lambda x: x[0]) |
| 22 | +sorted_main = sorted(zip(workers_main, time_main), key=lambda x: x[0]) |
| 23 | + |
| 24 | +# Unzip the sorted data |
| 25 | +workers_pr_sorted, time_pr_sorted = zip(*sorted_pr) |
| 26 | +workers_main_sorted, time_main_sorted = zip(*sorted_main) |
| 27 | + |
20 | 28 | # Create a plot
|
21 | 29 | plt.figure(figsize=(10, 6))
|
22 | 30 |
|
23 |
| -# Plot data from 'perf-data-PR.json' |
24 |
| -plt.plot(workers_pr, time_pr, marker='o', linestyle='-', label='PR Branch') |
| 31 | +# Plot sorted data from 'perf-data-PR.json' |
| 32 | +plt.plot(workers_pr_sorted, time_pr_sorted, marker='o', linestyle='-', label='PR Branch') |
25 | 33 |
|
26 |
| -# Plot data from 'perf-data-main.json' |
27 |
| -plt.plot(workers_main, time_main, marker='x', linestyle='--', label='Main Branch') |
| 34 | +# Plot sorted data from 'perf-data-main.json' |
| 35 | +plt.plot(workers_main_sorted, time_main_sorted, marker='x', linestyle='--', label='Main Branch') |
28 | 36 |
|
29 | 37 | # Add title, labels, grid, and legend
|
30 | 38 | plt.title('Time Taken by UffizziClusters with Varying Workers')
|
|
0 commit comments