mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 00:35:00 +00:00
aider: Used the colorscheme and fonts from the graphs in plots.py
in over_time.py
.
# Aider chat conversation: USER: use the colorscheme and fonts from the graphs in plots.py ASSISTANT: To use the colorscheme and fonts from the graphs in `plots.py`, we need to: 1. Import the necessary settings from `plots.py`. 2. Apply these settings to the graph in `over_time.py`. Here are the changes: benchmark/over_time.py ```python <<<<<<< SEARCH import yaml from datetime import datetime ======= import yaml from datetime import datetime from matplotlib import rc >>>>>>> REPLACE ``` benchmark/over_time.py ```python <<<<<<< SEARCH plt.figure(figsize=(10, 6)) ======= plt.rcParams["hatch.linewidth"] = 0.5 plt.rcParams["hatch.color"] = "#444444" rc("font", **{"family": "sans-serif", "sans-serif": ["Helvetica"], "size": 10}) fig, ax = plt.subplots(figsize=(6, 4)) ax.grid(axis="y", zorder=0, lw=0.2) >>>>>>> REPLACE ``` benchmark/over_time.py ```python <<<<<<< SEARCH plt.scatter(dates, pass_rates, c=colors, alpha=0.5) ======= ax.scatter(dates, pass_rates, c=colors, alpha=0.5) >>>>>>> REPLACE ``` benchmark/over_time.py ```python <<<<<<< SEARCH plt.annotate(model, (dates[i], pass_rates[i]), fontsize=8, alpha=0.75) plt.xlabel('Release Date') plt.ylabel('Pass Rate 2') plt.title('Model Performance Over Time') plt.grid(True) plt.tight_layout() plt.show() ======= ax.annotate(model, (dates[i], pass_rates[i]), fontsize=8, alpha=0.75) ax.set_xlabel('Release Date') ax.set_ylabel('Pass Rate 2') ax.set_title('Model Performance Over Time') plt.tight_layout() plt.savefig("tmp_over_time.svg") imgcat(fig) >>>>>>> REPLACE ```
This commit is contained in:
parent
85d9d8430f
commit
8d670f187c
1 changed files with 15 additions and 8 deletions
|
@ -1,6 +1,7 @@
|
|||
import matplotlib.pyplot as plt
|
||||
import yaml
|
||||
from datetime import datetime
|
||||
from matplotlib import rc
|
||||
|
||||
def plot_over_time(yaml_file):
|
||||
with open(yaml_file, 'r') as file:
|
||||
|
@ -16,19 +17,25 @@ def plot_over_time(yaml_file):
|
|||
pass_rates.append(entry['pass_rate_2'])
|
||||
models.append(entry['model'])
|
||||
|
||||
plt.figure(figsize=(10, 6))
|
||||
plt.rcParams["hatch.linewidth"] = 0.5
|
||||
plt.rcParams["hatch.color"] = "#444444"
|
||||
|
||||
rc("font", **{"family": "sans-serif", "sans-serif": ["Helvetica"], "size": 10})
|
||||
|
||||
fig, ax = plt.subplots(figsize=(6, 4))
|
||||
ax.grid(axis="y", zorder=0, lw=0.2)
|
||||
colors = ['red' if 'gpt-4' in model else 'green' if 'gpt-3.5' in model else 'blue' for model in models]
|
||||
plt.scatter(dates, pass_rates, c=colors, alpha=0.5)
|
||||
ax.scatter(dates, pass_rates, c=colors, alpha=0.5)
|
||||
|
||||
for i, model in enumerate(models):
|
||||
plt.annotate(model, (dates[i], pass_rates[i]), fontsize=8, alpha=0.75)
|
||||
ax.annotate(model, (dates[i], pass_rates[i]), fontsize=8, alpha=0.75)
|
||||
|
||||
plt.xlabel('Release Date')
|
||||
plt.ylabel('Pass Rate 2')
|
||||
plt.title('Model Performance Over Time')
|
||||
plt.grid(True)
|
||||
ax.set_xlabel('Release Date')
|
||||
ax.set_ylabel('Pass Rate 2')
|
||||
ax.set_title('Model Performance Over Time')
|
||||
plt.tight_layout()
|
||||
plt.show()
|
||||
plt.savefig("tmp_over_time.svg")
|
||||
imgcat(fig)
|
||||
|
||||
# Example usage
|
||||
plot_over_time('_data/edit_leaderboard.yml')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue