简体   繁体   中英

Writing Latex onto Axis

plt.xlabel(r'$\rm log \: M_*$')

plt.ylabel(r’$\rm log \: M_{\bullet}$')

The x axis is able to be printed correctly. However, the y axis has an error. What's the cause for that error?

If I take the Arial's answer in order to give a general solution, you have a wrong typo in the y line.

You write :

plt.ylabel(r’$\rm log \: M_{\bullet}$')

But, after the r, you made ' instead of '

So, you just have to write :

plt.ylabel(r'$\rm log \: M_{\bullet}$')

And your problem is solved ;)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM