12

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?

2 Answers 2

25

run the following code to get the font cache dir:

import matplotlib
matplotlib.get_cachedir()
Sign up to request clarification or add additional context in comments.

Comments

1

Consider matplotlib.font_manager

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.