import shutil import matplotlib import matplotlib.font_manager as fm fm.findSystemFonts() fm.fontManager.ttflist shutil.rmtree(matplotlib.get_cachedir())
可以手动载入字体定义bold样式,但感觉必要性不大。
1 2 3 4
font_path = "xxx" import matplotlib.font_manager as fm font = fm.FontEntry(font_path, name='Times New Roman', style='bold', weight=700) fm.fontManager.ttflist.insert(0, font)
Blog of Shane Hu
Welcome, friends!
This piece of writing is an original article, utilizing theCC BY-NC-SA 4.0Agreement. For complete reproduction, please acknowledge the source as Courtesy ofBlog of Shane Hu