Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -64,8 +64,8 @@ async def run_code(code: Code):
|
|
64 |
figures = [plt.figure(i) for i in plt.get_fignums()]
|
65 |
|
66 |
# Save all figures in a single PDF using PdfPages
|
67 |
-
pdf_filename = "all_graphs.pdf"
|
68 |
-
with PdfPages(
|
69 |
for fig in figures:
|
70 |
pdf.savefig(fig) # Save each figure as a page in the PDF
|
71 |
plt.close(fig) # Close the figure to free memory
|
|
|
64 |
figures = [plt.figure(i) for i in plt.get_fignums()]
|
65 |
|
66 |
# Save all figures in a single PDF using PdfPages
|
67 |
+
# pdf_filename = "all_graphs.pdf"
|
68 |
+
with PdfPages(file_path) as pdf:
|
69 |
for fig in figures:
|
70 |
pdf.savefig(fig) # Save each figure as a page in the PDF
|
71 |
plt.close(fig) # Close the figure to free memory
|