Fix Chinese font rendering in all chart outputs
- Add src/font_config.py: centralized font detection that auto-selects from Noto Sans SC > Hiragino Sans GB > STHeiti > Arial Unicode MS - Replace hardcoded font lists in all 18 modules with unified config - Add .gitignore for __pycache__, .DS_Store, venv, etc. - Regenerate all 70 charts with correct Chinese rendering Previously, 7 modules (fft, wavelet, acf, fractal, hurst, indicators, patterns) had no Chinese font config at all, causing □□□ rendering. The remaining 11 modules used a hardcoded fallback list that didn't prioritize the best available system font. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -543,9 +543,8 @@ def run_causality_analysis(
|
||||
print(f"因果变量对数: {len(CAUSALITY_PAIRS)}")
|
||||
print(f"总检验次数(含所有滞后): {len(CAUSALITY_PAIRS) * len(TEST_LAGS)}")
|
||||
|
||||
# 设置中文字体
|
||||
plt.rcParams['font.sans-serif'] = ['Arial Unicode MS', 'SimHei', 'DejaVu Sans']
|
||||
plt.rcParams['axes.unicode_minus'] = False
|
||||
from src.font_config import configure_chinese_font
|
||||
configure_chinese_font()
|
||||
|
||||
# --- 日线级 Granger 因果检验 ---
|
||||
print("\n>>> [1/4] 执行日线级 Granger 因果检验...")
|
||||
|
||||
Reference in New Issue
Block a user