python 画图 matplotlib 插入中文字体 for mac

python 画图 matplotlib中文字体 for mac
找到存放字体的路径
from matplotlib.font_manager import FontProperties
font_set = FontProperties(fname='/Library/Fonts/Songti.ttc', size=15)

plt.xlabel(u"中文",fontproperties=font_set)
plt.ylabel(u"中文",fontproperties=font_set)
plt.title(u"中文",fontproperties=font_set)

猜你喜欢

转载自blog.csdn.net/Jiiaaaoooo/article/details/89424412
今日推荐