findfont: Font family ['Times New Roman'] not found. Falling back to DejaVu Sans. findfont: Font family ['Times New Roman'] not found. Falling back to DejaVu Sans.
#Assuming you working on conda:
conda install -c conda-forge mscorefonts
#Then detete the cache as follows:
rm ~/.cache/matplotlib -rf
#Use the following as fit:
import matplotlib
myfonts = "Times New Roman"
matplotlib.rcParams['font.family'] = "sans-serif"
matplotlib.rcParams['font.sans-serif'] = myfonts