python字体下标不一样大
添加下标:_
添加上标:^
添加下标两个字时字体不一样大
import numpy as np
from matplotlib import pyplot as plt
t = np.linspace(0, 10, 1000)
y11 = np.sin(t)
y22 = np.sin(1.5*t)
y33 = np.sin(3*t)
y44 = np.sin(4*t)
plt.plot(t, y11,label = 'y_11',color = 'red', linewidth=0.8)
plt.plot(t,y22,label = "$y_{22}$",color = 'blue', linewidth=0.8)#推荐用法
plt.plot(t,y33,label = "${y_33}$",color = 'green', linewidth=0.8)#第二个3不是下标
plt.plot(t,y44,label = "${y_4}{_4}$",color = 'black', linewidth=0.8)#自创用法
plt.xlabel('a/${m^2}$', fontdict={'weight': 'normal', 'size': 15})
plt.legend() # 显示图例
plt.show()
###去掉斜体:
$\mathregular{m_2}$
``###说白了把你要做下标的部分用 { } 扩起来就行
参考文章:
https://blog.csdn.net/weixin_38314865/article/details/89392911