I am using matplotlib version 2.0.0 on Python 3 in a miniconda virtual environment. I am working on a unix scientific computing cluster where I don\'t have root privileges.
A solution for Windows users, when confronted with the warning:
UserWarning: findfont: Font family ['serif'] not found. Falling back to DejaVu Sans
(prop.get_family(), self.defaultFamily[fontext]))
Delete the fonts located in matplotlib's cache.
Cache's location: import matplotlib as mpl; print(mpl.font_manager.get_cachedir())
Find matplotlib's font directory. The path might be similar toC:\Miniconda3\pkgs\matplotlib-2.2.2-py36_1\Lib\site-packages\matplotlib\mpl-data\fonts\ttf
Copy necessary fonts like Computer Modern to this directory.
The warning may persist, but your plots' font should change appropriately.