python图例字体下标不一样大

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

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值