dibend commited on
Commit
72d608d
·
verified ·
1 Parent(s): f7fc25a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -59,14 +59,13 @@ def plot_crypto_price(crypto):
59
  plt.legend()
60
  plt.grid()
61
 
62
- plt.savefig("crypto_plot.png")
63
- return "crypto_plot.png"
64
 
65
  # Create Gradio Interface
66
  demo = gr.Interface(
67
  fn=plot_crypto_price,
68
  inputs=gr.Dropdown(choices=cryptos, label="Select Cryptocurrency"),
69
- outputs=gr.Image(type="file", label="Price Chart"),
70
  title="Cryptocurrency Price Visualization",
71
  description="Select a cryptocurrency to view its historical price data over the past year."
72
  )
 
59
  plt.legend()
60
  plt.grid()
61
 
62
+ return plt.gcf()
 
63
 
64
  # Create Gradio Interface
65
  demo = gr.Interface(
66
  fn=plot_crypto_price,
67
  inputs=gr.Dropdown(choices=cryptos, label="Select Cryptocurrency"),
68
+ outputs=gr.Plot(label="Price Chart"),
69
  title="Cryptocurrency Price Visualization",
70
  description="Select a cryptocurrency to view its historical price data over the past year."
71
  )