|
12 | 12 | ax.spines['top'].set_visible(False) |
13 | 13 | ax.spines['right'].set_visible(False) |
14 | 14 |
|
15 | | -for bar in bars: |
| 15 | +lang_labels = ["C++", "C++", "Rust", "C"] |
| 16 | +for i, bar in enumerate(bars): |
16 | 17 | yval = bar.get_height() |
17 | 18 | plt.text(bar.get_x() + bar.get_width()/2, yval + 50, f'{int(yval)} MB/s', |
18 | 19 | ha='center', va='bottom', fontsize=12) |
| 20 | + plt.text(bar.get_x() + bar.get_width()/2, yval + 150, lang_labels[i], |
| 21 | + ha='center', va='bottom', fontsize=12, color='black', fontweight='bold', style='italic') |
19 | 22 |
|
20 | 23 | plt.ylabel('Throughput (MB/s)', fontsize=14) |
21 | 24 | plt.ylim(0, 2500) |
|
38 | 41 | ax.spines['top'].set_visible(False) |
39 | 42 | ax.spines['right'].set_visible(False) |
40 | 43 |
|
| 44 | +lang_labels = ["C++", "C++", "Rust", "C", "C++"] |
41 | 45 | for i, bar in enumerate(bars): |
42 | 46 | yval = bar.get_height() |
43 | 47 | label = f'{yval} MB/s ⭐' if libraries_with[i] == 'simdjson' else f'{yval} MB/s' |
44 | 48 | plt.text(bar.get_x() + bar.get_width()/2, yval + 50, label, |
45 | 49 | ha='center', va='bottom', fontsize=12) |
| 50 | + plt.text(bar.get_x() + bar.get_width()/2, yval + 150, lang_labels[i], |
| 51 | + ha='center', va='bottom', fontsize=12, color='black', fontweight='bold', style='italic') |
46 | 52 |
|
47 | 53 | # Highlight simdjson |
48 | 54 | bars[-1].set_linewidth(3) |
|
69 | 75 | ax.spines['top'].set_visible(False) |
70 | 76 | ax.spines['right'].set_visible(False) |
71 | 77 |
|
| 78 | +lang_labels = ["C++", "C", "Rust", "C++", "C++"] |
72 | 79 | for i, bar in enumerate(bars): |
73 | 80 | yval = bar.get_height() |
74 | 81 | label = f'{yval} MB/s ⭐' if libraries_sorted[i] == 'simdjson' else f'{yval} MB/s' |
75 | 82 | plt.text(bar.get_x() + bar.get_width()/2, yval + 50, label, |
76 | 83 | ha='center', va='bottom', fontsize=12) |
| 84 | + plt.text(bar.get_x() + bar.get_width()/2, yval + 150, lang_labels[i], |
| 85 | + ha='center', va='bottom', fontsize=12, color='black', fontweight='bold', style='italic') |
77 | 86 |
|
78 | 87 | # Highlight simdjson |
79 | 88 | bars[0].set_linewidth(3) |
|
0 commit comments