苹果电脑找不到simhei字体,matplotlib绘图会乱码,可以用以下代码解决。
import matplotlib.pyplot as plt
plt.rcParams['axes.unicode_minus'] = False
from matplotlib.font_manager import FontManager
fm = FontManager()
fonts = set(f.name for f in fm.ttflist)
plt.rcParams["font.sans-serif"] = ["Arial Unicode MS"]