Update app.py
Browse files
app.py
CHANGED
|
@@ -9,7 +9,7 @@ def pd_bar():
|
|
| 9 |
return ax.get_figure()
|
| 10 |
def plt_line():
|
| 11 |
df = pd.DataFrame({'kc':['yw', 'sx', 'yy'], '成绩':[66, 98, 78]})
|
| 12 |
-
plt.plot(df['成绩'])
|
| 13 |
return plt
|
| 14 |
demo=gr.Blocks()
|
| 15 |
with demo:
|
|
@@ -33,8 +33,8 @@ myChart.setOption(option);
|
|
| 33 |
pd_button=gr.Button("pd_bar>>")
|
| 34 |
pd_output=gr.Plot(label="pd_chart1")
|
| 35 |
pd_button.click(pd_bar, inputs=[], outputs=pd_output)
|
| 36 |
-
with gr.TabItem("
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
demo.launch()
|
|
|
|
| 9 |
return ax.get_figure()
|
| 10 |
def plt_line():
|
| 11 |
df = pd.DataFrame({'kc':['yw', 'sx', 'yy'], '成绩':[66, 98, 78]})
|
| 12 |
+
plt.plot(df['成绩'],color='green',linestyle='dashed',marker='o',markerfacecolor='blue',markersize=20)
|
| 13 |
return plt
|
| 14 |
demo=gr.Blocks()
|
| 15 |
with demo:
|
|
|
|
| 33 |
pd_button=gr.Button("pd_bar>>")
|
| 34 |
pd_output=gr.Plot(label="pd_chart1")
|
| 35 |
pd_button.click(pd_bar, inputs=[], outputs=pd_output)
|
| 36 |
+
with gr.TabItem("plt_line"):
|
| 37 |
+
plt_button=gr.Button("plt_line>>")
|
| 38 |
+
plt_output=gr.Plot(label="plt_chart")
|
| 39 |
+
plt_button.click(plt_line, inputs=[], outputs=plt_output)
|
| 40 |
demo.launch()
|