Latex on python: \alpha and \beta don't work?

后端 未结 2 340
夕颜
夕颜 2021-02-02 12:30

I\'m using matplotlib to produce some graphics, and I\'m using latex for the legends.

More specifically, I\'m trying to use something like this:

loglog(x         


        
2条回答
  •  无人共我
    2021-02-02 12:52

    The issue is that \a and \b have special meaning inside a Python string literal.

    I recommend that you use raw strings whenever there is a backslash embedded inside a string:

    r'$ \alpha $'
    

提交回复
热议问题