mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 00:35:00 +00:00
aider: Add imgcat to display the graph after saving it.
# Aider chat conversation: USER: save it as a png and svg and imgcat it out ASSISTANT: To save the graph as a PNG and SVG and then display it using `imgcat`, we need to modify `benchmark/swe_bench_lite.py`: 1. Import `imgcat`. 2. Add `imgcat` to display the graph after saving it. Here are the *SEARCH/REPLACE* blocks: benchmark/swe_bench_lite.py ```python <<<<<<< SEARCH from matplotlib import rc ======= from matplotlib import rc from imgcat import imgcat >>>>>>> REPLACE ``` benchmark/swe_bench_lite.py ```python <<<<<<< SEARCH plt.show() ======= imgcat(fig) plt.show() >>>>>>> REPLACE ```
This commit is contained in:
parent
c9349d6e23
commit
5761218b9a
1 changed files with 2 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
|||
import matplotlib.pyplot as plt
|
||||
from matplotlib import rc
|
||||
from imgcat import imgcat
|
||||
|
||||
def plot_swe_bench_lite(data_file):
|
||||
with open(data_file, "r") as file:
|
||||
|
@ -41,6 +42,7 @@ def plot_swe_bench_lite(data_file):
|
|||
plt.tight_layout()
|
||||
plt.savefig("swe_bench_lite.png")
|
||||
plt.savefig("swe_bench_lite.svg")
|
||||
imgcat(fig)
|
||||
plt.show()
|
||||
|
||||
# Example usage
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue