Matlplotlib对LaTeX有一定的支持,如果记得使用raw字符串语法会很自然:

xlabel(r"

在matplotlib里面,可以使用LaTex的命令来编辑公式,只需要在字符串前面加一个“r”即可

Here is a simple example:

# plain text
plt.title('alpha > beta')

produces “alpha > beta”.

Whereas this:

     matplotlib对LaTeX数学公式的支持

produces "matplotlib对LaTeX数学公式的支持".

 

相关文章: