9

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?

user3736071
  • 93
  • 1
  • 4

2 Answers2

19

run the following code to get the font cache dir:

import matplotlib
matplotlib.get_cachedir()
HYRY
  • 89,863
  • 23
  • 181
  • 185
1

Consider matplotlib.font_manager

A module for finding, managing, and using fonts across platforms.

Community
  • 1
  • 1
agamike
  • 479
  • 3
  • 5