From d37bace5d70627452a87544dfc8c63d407cd10cb Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Thu, 23 May 2024 09:56:04 -0700 Subject: [PATCH] aider: Make the percentages on top of Aider's bars and the Aider x labels bold. # Aider chat conversation: USER: make the percentages on top of aiders bars bold. make the aider x labels bold too ASSISTANT: To make the percentages on top of Aider's bars bold and the Aider x labels bold, we need to modify the text properties in the plotting section. Here are the *SEARCH/REPLACE* blocks: benchmark/swe_bench_lite.py ```python <<<<<<< SEARCH if "Aider" in model: y = yval + 0.75 va = "bottom" else: y = yval - 1.25 va = "top" ax.text( bar.get_x() + bar.get_width() / 2, y, f"{yval}%", ha="center", va=va, fontsize=14, # alpha=0.75, ) ======= y = yval + 0.75 if "Aider" in model else yval - 1.25 va = "bottom" if "Aider" in model else "top" fontweight = "bold" if "Aider" in model else "normal" ax.text( bar.get_x() + bar.get_width() / 2, y, f"{yval}%", ha="center", va=va, fontsize=14, fontweight=fontweight, ) >>>>>>> REPLACE ``` benchmark/swe_bench_lite.py ```python <<<<<<< SEARCH plt.xticks( # rotation=45, # ha="center", fontsize=16, color=font_color, ) ======= xticks = plt.xticks( fontsize=16, color=font_color, ) for label in xticks[1]: if "Aider" in label.get_text(): label.set_fontweight("bold") >>>>>>> REPLACE ``` --- benchmark/swe_bench_lite.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/benchmark/swe_bench_lite.py b/benchmark/swe_bench_lite.py index abaebb6e3..a7a0f77eb 100644 --- a/benchmark/swe_bench_lite.py +++ b/benchmark/swe_bench_lite.py @@ -40,12 +40,9 @@ def plot_swe_bench_lite(data_file): for model, bar in zip(models, bars): yval = bar.get_height() - if "Aider" in model: - y = yval + 0.75 - va = "bottom" - else: - y = yval - 1.25 - va = "top" + y = yval + 0.75 if "Aider" in model else yval - 1.25 + va = "bottom" if "Aider" in model else "top" + fontweight = "bold" if "Aider" in model else "normal" ax.text( bar.get_x() + bar.get_width() / 2, @@ -54,19 +51,20 @@ def plot_swe_bench_lite(data_file): ha="center", va=va, fontsize=14, - # alpha=0.75, + fontweight=fontweight, ) # ax.set_xlabel("Models", fontsize=18) ax.set_ylabel("Instances resolved (%)", fontsize=18, color=font_color) ax.set_title("SWE Bench Lite", fontsize=20) ax.set_ylim(0, 29.9) - plt.xticks( - # rotation=45, - # ha="center", + xticks = plt.xticks( fontsize=16, color=font_color, ) + for label in xticks[1]: + if "Aider" in label.get_text(): + label.set_fontweight("bold") plt.tight_layout(pad=3.0) plt.savefig("swe_bench_lite.jpg") plt.savefig("swe_bench_lite.svg")