Update app.py
Browse files
app.py
CHANGED
|
@@ -7,9 +7,9 @@ def pd_bar():
|
|
| 7 |
df = pd.DataFrame({'kc':['yw', 'sx', 'yy'], 'cj':[66, 98, 78]})
|
| 8 |
ax = df.plot(x='kc',y='cj',kind='bar',title='chinese word error!', color=["red","green","purple"],rot=0)
|
| 9 |
return ax.get_figure()
|
| 10 |
-
def
|
| 11 |
-
df = pd.DataFrame({'kc':['yw', 'sx', 'yy'], '
|
| 12 |
-
plt.plot(df['
|
| 13 |
return plt
|
| 14 |
demo=gr.Blocks()
|
| 15 |
with demo:
|
|
@@ -36,5 +36,5 @@ myChart.setOption(option);
|
|
| 36 |
with gr.TabItem("pd_line"):
|
| 37 |
pd2_button=gr.Button("pd_line>>")
|
| 38 |
pd2_output=gr.Plot(label="pd_chart2")
|
| 39 |
-
pd2_button.click(
|
| 40 |
demo.launch()
|
|
|
|
| 7 |
df = pd.DataFrame({'kc':['yw', 'sx', 'yy'], 'cj':[66, 98, 78]})
|
| 8 |
ax = df.plot(x='kc',y='cj',kind='bar',title='chinese word error!', color=["red","green","purple"],rot=0)
|
| 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:
|
|
|
|
| 36 |
with gr.TabItem("pd_line"):
|
| 37 |
pd2_button=gr.Button("pd_line>>")
|
| 38 |
pd2_output=gr.Plot(label="pd_chart2")
|
| 39 |
+
pd2_button.click(plt_line, inputs=[], outputs=pd2_output)
|
| 40 |
demo.launch()
|