Update app.py
Browse files
app.py
CHANGED
@@ -2,21 +2,6 @@ import gradio as gr
|
|
2 |
import pandas as pd
|
3 |
from datatable import (dt, f,fread, by, ifelse, update, sort,count, min, max, mean, sum, rowsum,rowmean,rowcount,shift,rbind,cbind,union)
|
4 |
import requests
|
5 |
-
import matplotlib
|
6 |
-
matplotlib.use('Agg')
|
7 |
-
import matplotlib.pyplot as plt
|
8 |
-
plt.rcParams["font.sans-serif"]=["SimHei"]
|
9 |
-
def fx_tb():
|
10 |
-
fig=plt.figure()
|
11 |
-
ax = fig.add_axes([0,0,1,1])
|
12 |
-
x =["一月", "二月", "三月", "四月"]
|
13 |
-
y = [12, 22, 6, 18]
|
14 |
-
ax.bar(x,y)
|
15 |
-
ax.set_xlabel('月份')
|
16 |
-
ax.set_ylabel('销量')
|
17 |
-
ax.set_title('A公司销售情况表')
|
18 |
-
ax.set_yticks([0,4,8,12,16,20])
|
19 |
-
return fig
|
20 |
|
21 |
'''
|
22 |
import hashlib
|
@@ -168,8 +153,4 @@ py_exe=d_t.to_pandas()'''
|
|
168 |
S='<iframe style="height: 600px; width: 100%;" src="https://app.kuhuace.com/player/index.html?id=60" allowfullscreen="allowfullscreen"><iframe>'
|
169 |
gr.HTML(S)
|
170 |
|
171 |
-
with gr.TabItem("图表"):
|
172 |
-
gr.Markdown("# 画图测试")
|
173 |
-
tb_button=gr.Button("显示")
|
174 |
-
tb_button.click(fx_tb,[],gr.Plot())
|
175 |
demo.launch()
|
|
|
2 |
import pandas as pd
|
3 |
from datatable import (dt, f,fread, by, ifelse, update, sort,count, min, max, mean, sum, rowsum,rowmean,rowcount,shift,rbind,cbind,union)
|
4 |
import requests
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
|
6 |
'''
|
7 |
import hashlib
|
|
|
153 |
S='<iframe style="height: 600px; width: 100%;" src="https://app.kuhuace.com/player/index.html?id=60" allowfullscreen="allowfullscreen"><iframe>'
|
154 |
gr.HTML(S)
|
155 |
|
|
|
|
|
|
|
|
|
156 |
demo.launch()
|