Matplotlib can't find font

后端 未结 3 1050
我寻月下人不归
我寻月下人不归 2021-01-04 19:27

I am trying to draw an xkcd-style plot with matplotlib (ver. 1.4.2) under Python 3.

When I try to run:

import matplotlib.pyplot as plt
plt.xkcd()
plt         


        
3条回答
  •  轮回少年
    2021-01-04 20:02

    If you add a new font after installing matplotlib then try to remove the font cache. Matplotlib will have to rebuild the cache, thereby adding the new font.

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

提交回复
热议问题