This commit is contained in:
chigoma333
2026-07-21 16:27:29 +02:00
parent 4503f99135
commit c050194be4
2 changed files with 41 additions and 14 deletions
+18 -5
View File
@@ -16,8 +16,14 @@ def format_val(x, pos=None):
# ==========================================
# 1. EDIT YOUR DATA HERE
# ==========================================
labels = ['Tetris AI test CPU', 'tet_cpu_per_row', '4 tet_cpu_per_row']
values = [41700, 909000, 909000*4] # e.g., Speed, FPS, Transactions per second (Higher is better)
# Define primary labels and subtext descriptions
labels_main = ['Bitboard Tetris', 'TET-CPU']
subtexts = ['AMD R7-7735H', '50Mhz']
# Combine them with newline characters
labels = [f"{main}\n{sub}" for main, sub in zip(labels_main, subtexts)]
values = [41700, 909000] # e.g., Speed, FPS, Transactions per second (Higher is better)
# Define your unit here (add a space at the start so it looks clean)
unit_label = "Moves per Second [Moves/sec]"
@@ -41,7 +47,7 @@ bars = ax.barh(labels, values, color=[competitor_color, brand_color], height=0.4
# ==========================================
# 3. CONFIGURE AXES
# ==========================================
# X-Axis Tick Formatting (The requested change)
# X-Axis Tick Formatting
ax.xaxis.set_major_formatter(ticker.FuncFormatter(format_val))
for spine in ax.spines.values():
@@ -50,7 +56,12 @@ ax.spines['bottom'].set_visible(True)
ax.spines['bottom'].set_color('white')
ax.spines['bottom'].set_path_effects(black_outline)
ax.tick_params(axis='both', colors='white', labelsize=12)
# Set base size for x-axis ticks
ax.tick_params(axis='x', colors='white', labelsize=12)
# Set larger font size specifically for Y-axis labels (Option 1)
ax.tick_params(axis='y', colors='white', labelsize=18)
for label in ax.get_xticklabels() + ax.get_yticklabels():
label.set_path_effects(black_outline)
@@ -83,7 +94,9 @@ multiplier_txt = ax.text(x_line + (max_val * 0.03), (y0+y1)/2, f'{multiplier:.1f
ha='left', va='center', color=brand_color, fontsize=22, fontweight='heavy')
multiplier_txt.set_path_effects(black_outline)
ax.set_xlim(0, max_val * 1.45)
# Set x-axis limit to end around 1.1M
ax.set_xlim(0, 1_100_000)
plt.tight_layout()
plt.subplots_adjust(bottom=0.2)