mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-31 01:35:00 +00:00
![]() # Context: USER: switch the plt stuff to use an explicit fig ASSISTANT: To switch the matplotlib plotting to use an explicit figure, we need to modify the `show_stats` function in the `benchmark/benchmark.py` file. Here are the changes: ```python benchmark/benchmark.py <<<<<<< ORIGINAL df_grouped.unstack().plot(kind="barh", figsize=(10, 6)) plt.xlabel("Pass Rate 1") plt.ylabel("Model") plt.title("Pass Rate 1 for each Model/Edit Format") plt.legend(title="Edit Format") plt.show() ======= fig, ax = plt.subplots(figsize=(10, 6)) df_grouped.unstack().plot(kind="barh", ax=ax) ax.set_xlabel("Pass Rate 1") ax.set_ylabel("Model") ax.set_title("Pass Rate 1 for each Model/Edit Format") ax.legend(title="Edit Format") plt.show() >>>>>>> UPDATED ``` This change creates a new figure and axes before plotting, and then uses the axes for setting labels, title, and legend. This is a more explicit way of handling figures and axes in matplotlib. |
||
---|---|---|
.. | ||
__init__.py | ||
benchmark.py | ||
docker.sh | ||
docker_build.sh | ||
Dockerfile | ||
prompts.py | ||
test_benchmark.py |