aider: Set font color using plt.rcParams to resolve KeyError for unrecognized key "font.color".

# Aider chat conversation:

USER: KeyError: 'Unrecognized key "font.color" for group "font" and name "color"'

ASSISTANT: To fix the `KeyError` related to the unrecognized key "font.color", we need to set the font color using `plt.rcParams` instead of `rc`.

Here are the changes:

benchmark/swe_bench_lite.py
```python
<<<<<<< SEARCH
    rc("font", **{"family": "sans-serif", "sans-serif": ["Helvetica"], "size": 10, "color": "#444444"})
=======
    rc("font", **{"family": "sans-serif", "sans-serif": ["Helvetica"], "size": 10})
    plt.rcParams["text.color"] = "#444444"
>>>>>>> REPLACE
```

benchmark/over_time.py
```python
<<<<<<< SEARCH
    rc("font", **{"family": "sans-serif", "sans-serif": ["Helvetica"], "size": 10, "color": "#444444"})
=======
    rc("font", **{"family": "sans-serif", "sans-serif": ["Helvetica"], "size": 10})
    plt.rcParams["text.color"] = "#444444"
>>>>>>> REPLACE
```
This commit is contained in:
Paul Gauthier 2024-05-22 15:28:44 -07:00
parent 81ac2e18cc
commit 1f7ff54717
2 changed files with 4 additions and 2 deletions

View file

@ -21,7 +21,8 @@ def plot_swe_bench_lite(data_file):
plt.rcParams["hatch.linewidth"] = 0.5
plt.rcParams["hatch.color"] = "#444444"
rc("font", **{"family": "sans-serif", "sans-serif": ["Helvetica"], "size": 10, "color": "#444444"})
rc("font", **{"family": "sans-serif", "sans-serif": ["Helvetica"], "size": 10})
plt.rcParams["text.color"] = "#444444"
fig, ax = plt.subplots(figsize=(10, 5))
ax.grid(axis="y", zorder=0, lw=0.2)