Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -4,6 +4,7 @@ import matplotlib.pyplot as plt
|
|
4 |
import pandas as pd
|
5 |
|
6 |
def graphPlot():
|
|
|
7 |
inp_list = [[13,0,8425333,'Asia'],
|
8 |
[15,1,9712569,'Oceania'],
|
9 |
[52,0,76039390,'Americas'],
|
@@ -32,9 +33,17 @@ def graphPlot():
|
|
32 |
plt.annotate(b, xy=(X[i], Y[i]))
|
33 |
# Show the plot
|
34 |
plt.show()
|
35 |
-
return
|
36 |
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
import pandas as pd
|
5 |
|
6 |
def graphPlot():
|
7 |
+
fig = plt.figure()
|
8 |
inp_list = [[13,0,8425333,'Asia'],
|
9 |
[15,1,9712569,'Oceania'],
|
10 |
[52,0,76039390,'Americas'],
|
|
|
33 |
plt.annotate(b, xy=(X[i], Y[i]))
|
34 |
# Show the plot
|
35 |
plt.show()
|
36 |
+
return fig
|
37 |
|
38 |
+
inputs = [
|
39 |
+
gr.Dropdown(["Matplotlib", "Plotly", "Bokeh"], label="Plot Type"),
|
40 |
+
gr.Slider(1, 4, 3.2, label="R"),
|
41 |
+
gr.Dropdown(["January", "February", "March", "April", "May"], label="Month"),
|
42 |
+
gr.CheckboxGroup(["USA", "Canada", "Mexico", "UK"], label="Countries",
|
43 |
+
value=["USA", "Canada"]),
|
44 |
+
gr.Checkbox(label="Social Distancing?"),
|
45 |
+
]
|
46 |
+
outputs = gr.Plot()
|
47 |
+
|
48 |
+
demo = gr.Interface(fn=graphPlot, inputs=inputs, outputs=outputs, cache_examples=True)
|
49 |
+
demo.launch()
|