【问题标题】:Unable to find font cache of matplotlib on a mac在 Mac 上找不到 matplotlib 的字体缓存
【发布时间】:2018-05-03 18:10:53
【问题描述】:

我对此进行了很多研究,但无法让它发挥作用。

如何更改 matplotlib 的字体?

根据我的研究,我认为我的问题是字体缓存。

我在正确的文件夹中有 ttf。

人们一直在说 rm ~/.matplotlib/fontList.cache

是要使用的命令,但我在计算机上的任何位置都找不到 .matplotlib 文件夹或 fontlist.cache。

我使用的是 Mac。 我需要提供更多信息还是看起来可能只是缓存? 如果是缓存,如何清除?

【问题讨论】:

    标签: python-2.7 matplotlib


    【解决方案1】:

    运行以下代码获取字体缓存目录:

    import matplotlib
    matplotlib.get_cachedir()
    

    【讨论】:

      【解决方案2】:

      考虑matplotlib.font_manager

      一个用于跨平台查找、管理和使用字体的模块。

      【讨论】:

        猜你喜欢
        • 2017-06-25
        • 2016-12-28
        • 2014-11-23
        • 2016-10-21
        • 2019-02-18
        • 1970-01-01
        • 2011-05-14
        • 2011-11-09
        相关资源
        最近更新 更多