酒窖设计,宁波seo外包哪个品牌好,如何制作3d效果图,深圳最新新闻【问题描述】
①报错确缺失字体#xff1a; ②使用matplotlib画图#xff0c;中文字体显示不出来 【问题思考】
在网上搜了好多#xff0c;关于使用python进行matplotlib画图字体显示不出来的#xff0c;但是我试用了下#xff0c;对我来说都没有。有些仅使用于windows系…【问题描述】
①报错确缺失字体 ②使用matplotlib画图中文字体显示不出来 【问题思考】
在网上搜了好多关于使用python进行matplotlib画图字体显示不出来的但是我试用了下对我来说都没有。有些仅使用于windows系统某些博主还起标题适用于mac瞎扯。
【解决办法】
①首先查看下mac里面的使用于matplotlib画图有那些字体呢。
# 查看matplotlib中的字体有哪些
from matplotlib.font_manager import FontManager
mpl_fonts set(f.name for f in FontManager().ttflist)
print(all font list get from matplotlib.font_manager:)
for font in sorted(mpl_fonts):print(\t font) ②选择1-2个自己熟悉的字体使用即可。
import matplotlib.pyplot as plt
plt.rc(font, familyPingFang HK) # 选择自己想要的字体就行
③运行后字体就可以显示啦。 噢耶可以咯继续学习