Spaces:
Sleeping
Sleeping
Commit
·
363136b
1
Parent(s):
f57852c
add support for Chinese font in matplotlib configuration
Browse files
app.py
CHANGED
|
@@ -10,6 +10,10 @@ from scipy.spatial import cKDTree
|
|
| 10 |
import pandas as pd
|
| 11 |
from loguru import logger
|
| 12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
# GPU/CPU 設定
|
| 14 |
if torch.cuda.is_available():
|
| 15 |
device = torch.device("cuda")
|
|
|
|
| 10 |
import pandas as pd
|
| 11 |
from loguru import logger
|
| 12 |
|
| 13 |
+
# 設定 matplotlib 中文字體支援
|
| 14 |
+
plt.rcParams['font.sans-serif'] = ['Arial Unicode MS', 'DejaVu Sans']
|
| 15 |
+
plt.rcParams['axes.unicode_minus'] = False # 解決負號顯示問題
|
| 16 |
+
|
| 17 |
# GPU/CPU 設定
|
| 18 |
if torch.cuda.is_available():
|
| 19 |
device = torch.device("cuda")
|