matplotlib 使用 Windows 系统字体
导入 FontProperties
from matplotlib.font_manager import FontProperties
可以使用自己电脑上(C:\Windows\Fonts)的字体
font = FontProperties(fname=r"C:\Windows\Fonts\simhei.ttf", size=12)
使用字体
plt.xlabel("X轴标题",FontProperties=font)
导入 FontProperties
from matplotlib.font_manager import FontProperties
可以使用自己电脑上(C:\Windows\Fonts)的字体
font = FontProperties(fname=r"C:\Windows\Fonts\simhei.ttf", size=12)
使用字体
plt.xlabel("X轴标题",FontProperties=font)