matplotlib绘图设置中文

问题遇到的现象和发生背景

按照你的方法设置最后一步:运行代码重新加载配置

问题相关代码,请勿粘贴截图

from matplotlib.font_manager import _rebuild
_rebuild()#执行该函数加载字体配置

运行结果及报错内容

ImportError: cannot import name '_rebuild' from 'matplotlib.font_manager'

我的解答思路和尝试过的方法
我想要达到的结果
Name: matplotlib
Version: 3.1.1

设置中文字体这样就可以了 , 你的 matplotlib 是什么版本?

from matplotlib import pyplot as plt
plt.rcParams['font.sans-serif'] = ['SimHei']