Python 更改matplotlib中的latex数学字体样式

Python 更改matplotlib中的latex数学字体样式,python,matplotlib,Python,Matplotlib,使用latex时,如何更改matplotlib中的数学字体样式。例如,我有 matplotlib_font$_{latex_font}$ matplotlib_字体显示为我的rc文件中设置的字体,Latex_字体显示在computer modern中。我不想让我所有的字体都用Latex,也就是说,我想让rc文件保持原样 text.usetex : False 但是我需要我的latex字体来匹配matplotlib字体 在rc(matplotlibrc)文件集中找到了它 然后

使用latex时,如何更改matplotlib中的数学字体样式。例如,我有

matplotlib_font$_{latex_font}$
matplotlib_字体显示为我的rc文件中设置的字体,Latex_字体显示在computer modern中。我不想让我所有的字体都用Latex,也就是说,我想让rc文件保持原样

text.usetex         : False 
但是我需要我的latex字体来匹配matplotlib字体

在rc(matplotlibrc)文件集中找到了它

然后用数学模式中需要的字体更新数学文本

mathtext.rm  : Times New Roman
mathtext.it  : Times New Roman:italic
mathtext.bf  : Times New Roman:bold

我删除了
mathtext.tt:Times New Roman
,因为我不相信这是必要的,因为LaTex没有使用它。
mathtext.rm  : Times New Roman
mathtext.it  : Times New Roman:italic
mathtext.bf  : Times New Roman:bold