Python 2.7 更改matplotlib中记号标签的字体
如何更改matplotlib记号标签的字体?我想把它改成Computer Modern 10(我相信在matplotlib中称为“cm”),但是,我不想用TeX渲染它。我尝试了很多方法,但似乎都不管用Python 2.7 更改matplotlib中记号标签的字体,python-2.7,matplotlib,Python 2.7,Matplotlib,如何更改matplotlib记号标签的字体?我想把它改成Computer Modern 10(我相信在matplotlib中称为“cm”),但是,我不想用TeX渲染它。我尝试了很多方法,但似乎都不管用 func = lambda x, pos: "" if np.isclose(x,0) else x plt.gca().xaxis.set_major_formatter(matplotlib.ticker.FuncFormatter(func)) plt.gca().yaxis.set_maj
func = lambda x, pos: "" if np.isclose(x,0) else x
plt.gca().xaxis.set_major_formatter(matplotlib.ticker.FuncFormatter(func))
plt.gca().yaxis.set_major_formatter(matplotlib.ticker.FuncFormatter(func))
在我的情况下有效
在我的情况下有效 这只是,与更改字体无关。这只是,与更改字体无关。