Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,13 +1,17 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import pandas as pd
|
|
|
|
| 3 |
import matplotlib.pyplot as plt
|
| 4 |
import warnings
|
| 5 |
|
| 6 |
warnings.filterwarnings(action='ignore', category=UserWarning)
|
| 7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
-
plt.rcParams['font.family'] = 'ans-serif'
|
| 10 |
-
plt.rcParams['font.sans-serif'] = ['SimHei'] # 例如设置为中文字体“黑体”
|
| 11 |
plt.rcParams['axes.unicode_minus'] = False # 设置正常显示字符
|
| 12 |
|
| 13 |
def process_file(file):
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import pandas as pd
|
| 3 |
+
import matplotlib.font_manager as font_manager
|
| 4 |
import matplotlib.pyplot as plt
|
| 5 |
import warnings
|
| 6 |
|
| 7 |
warnings.filterwarnings(action='ignore', category=UserWarning)
|
| 8 |
|
| 9 |
+
font_path = './SimHei.ttf' # 替换为实际的字体文件路径
|
| 10 |
+
|
| 11 |
+
font_manager.fontManager.addfont(font_path)
|
| 12 |
+
plt.rcParams['font.family'] = 'SimHei' # 将 'custom_font' 替换为您为该字体指定的名称
|
| 13 |
+
|
| 14 |
|
|
|
|
|
|
|
| 15 |
plt.rcParams['axes.unicode_minus'] = False # 设置正常显示字符
|
| 16 |
|
| 17 |
def process_file(file):
|