Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to find font cache of matplotlib on a mac

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

How can I change the font for matplotlib?

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

I have the ttf in the right folder.

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

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

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?

like image 829
user3736071 Avatar asked Jun 13 '14 01:06

user3736071


People also ask

Where is matplotlib font cache?

It may be located under ~/. matplotlib/fontList. cache or ~/. cache/matplotlib/fontList.

How do I add fonts to matplotlib?

Usually, double-click on the . ttf file and then click on the Install button in the window that pops up. Note that Matplotlib handles fonts in True Type Format (. ttf) , so make sure you install fonts ending in .

What is the default font in matplotlib?

The default font has changed from "Bitstream Vera Sans" to "DejaVu Sans".


1 Answers

run the following code to get the font cache dir:

import matplotlib
matplotlib.get_cachedir()
like image 153
HYRY Avatar answered Sep 28 '22 06:09

HYRY