简体   繁体   English

使用matplotlib打印乳胶轴值

[英]printing latex axes values using matplotlib

objects = ('AB_{3}', 'AB_{5}', 'AB_{10}', 'AB_{55}', 'AB_{1}', 'AB_{200}')
y_pos = np.arange(len(objects))

I want to print y_pos as a latex formula. 我想将y_pos打印为乳胶配方。 Is there a way I can set the format of a tick values in matplotlib? 有没有办法可以在matplotlib中设置刻度值的格式?

Matplotlib uses mathtext to typeset latex-like markup. Matplotlib使用mathtext排版类似乳胶的标记。 All you need to do is using the math mode in your labels. 您需要做的就是在标签中使用数学模式。

objects = ('$AB_{3}$', '$AB_{5}$', '$AB_{10}$', '$AB_{55}$', '$AB_{1}$', '$AB_{200}$')

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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