I would like to be able to place
import matplotlib as mpl
import matplotlib.pyplot as plt
import matplotlib.font_manager as font_manager
path = '/usr/share/fonts/truetype/msttcorefonts/Comic_Sans_MS.ttf'
prop = font_manager.FontProperties(fname=path)
mpl.rcParams['font.family'] = prop.get_name()
fig, ax = plt.subplots()
ax.set_title('Text in a cool font', size=40)
import matplotlib; matplotlib.get_configdir()
In case anyone cares, I decided it's most convenient to just copy my
.ttf files to the directory that looks something like
~/anaconda/lib/python2.7/site-packages/matplotlib/mpl-data/fonts/ttf. The files were still there after I updated matplotlib, so at least it will probably be a while before I will have to repeat the process, and this way I don't need to point to a directory or call a script every time I plot. If you do this and/or change your default font list in your
matplotlibrc file (both of which I did) you'll probably have to delete your cache file located somewhere like
~/.matplotlib/fontList.cache or ~/.cache/matplotlib/fontList.cache`. Matplotlib will regenerate this next time you plot something.