如何获取Matplotlib当前可用的所有字体的列表?
要获取当前可用于Matplotlib的所有字体的列表,我们可以使用font_manager.findSystemFonts()方法.
步骤
打印语句
使用font_manager.findSystemFonts()方法获取可用字体列表。
示例
from matplotlib import font_manager
print("List of all fonts currently available in the matplotlib:\n")
print(*font_manager.findSystemFonts(fontpaths=None, fontext='ttf'), sep="\n")输出结果/usr/share/fonts/truetype/Nakula/nakula.ttf /usr/share/fonts/truetype/ubuntu/Ubuntu-L.ttf /usr/share/fonts/truetype/tlwg/Loma-BoldOblique.ttf ................................................................. ............................................................................ ................................................................................. ........ /usr/share/fonts/truetype/lohit-malayalam/Lohit-Malayalam.ttf /usr/share/fonts/truetype/tlwg/TlwgTypist-Oblique.ttf /usr/share/fonts/truetype/liberation2/LiberationMono-Bold.ttf
热门推荐
10 情侣祝福语古文简短独特
11 酒店伴娘祝福语简短
12 晚上甜蜜的祝福语简短
13 给新娘简短的祝福语
14 当爸爸的简短祝福语
15 洛宁新年祝福语大全简短
16 新年祝福语简短搞笑幽默
17 结婚祝福语大全简短霸气
18 新人结婚祝福语简短高端