在Mac上找不到Matplotlib的字体缓存 [英] Unable to find font cache of matplotlib on a mac

查看:127
本文介绍了在Mac上找不到Matplotlib的字体缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对此进行了大量研究,但无法让它发挥作用.

I've researched this a lot and can't get it to work.

如何更改matplotlib的字体?

How can I change the font for matplotlib?

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

I think my issue is the font cache, based on my research.

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

I have the ttf in the right folder.

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

people keep saying rm ~/.matplotlib/fontList.cache

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

is the command to use, but I can't find a .matplotlib folder or a fontlist.cache anywhere on my computer.

我正在使用Mac.我是否需要提供更多信息,或者看起来可能只是缓存?如果是缓存,如何清除?

I'm using a Mac. Do I need to provide more information or does it seem like it might just be the cache? If it's the cache, how do I clear it?

推荐答案

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

run the following code to get the font cache dir:

import matplotlib
matplotlib.get_cachedir()

这篇关于在Mac上找不到Matplotlib的字体缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆