Ubuntu本身不自带Times New Roman字体,
安装Times New Roman字体
sudo apt-get update
sudo apt-get install ttf-mscorefonts-installer
删除字体缓存列表
先找到字体缓存位置
# python语言
import matplotlib
matplotlib.get_cachedir()
删除文件夹下内容
# 如果是jupyter需要重启一下
import matplotlib.pyplot as plt
plt.rc('font', family="Times New Roman")
OK