2021年2月9日星期二

How to use a raw string for latex with a string variable?

I was trying to use latex in one of my labels for a matplotlib plot. As shown on matplotlib website, using an r in the beginning of the string helps me do that. as shown below:

plt.title(r'$\alpha > \beta$')

But now, I want to replace the inside of the string ('$\alpha > \beta$') with a variable. I tried some combinations but it doesn't work.

Any help is appreciated, Thanks a lot!

https://stackoverflow.com/questions/66130745/how-to-use-a-raw-string-for-latex-with-a-string-variable February 10, 2021 at 12:01PM

没有评论:

发表评论