jonathanjordan21 commited on
Commit
9fe7bf2
·
verified ·
1 Parent(s): 2850603

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -49,12 +49,12 @@ async def run_code(code: Code):
49
 
50
  file_path = "graph.pdf"
51
 
52
- if code.code == "plt.subplots(":
53
  print("SUBPLOTS DETECTED")
54
- exec(code.code + "\nfig.savefig(file_path)")
55
  else:
56
  print("NO SUBPLOTS")
57
- exec(code.code + "\nplt.savefig(file_path)")
58
 
59
  plt.close()
60
  # plt.savefig(file_path)
 
49
 
50
  file_path = "graph.pdf"
51
 
52
+ if "plt.subplots(" in code.code:
53
  print("SUBPLOTS DETECTED")
54
+ exec(code.code + "\nfig.savefig(file_path)\nplt.close()")
55
  else:
56
  print("NO SUBPLOTS")
57
+ exec(code.code + "\nplt.savefig(file_path)\nplt.close()")
58
 
59
  plt.close()
60
  # plt.savefig(file_path)