changxin commited on
Commit
eb73ff6
·
1 Parent(s): 066e275

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
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 pd_line():
11
- df = pd.DataFrame({'kc':['yw', 'sx', 'yy'], 'cj':[66, 98, 78]})
12
- plt.plot(df['cj'])
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(pd_line, inputs=[], outputs=pd2_output)
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()