我可以在 matplotlib 轴标签中使用两种不同的字体大小吗?

Can I have two different font sizes in a matplotlib axes label?

是否可以在一个 matplotlib 轴标签中使用两种不同的字体大小? 我知道我可以用

设置字体大小

fontsize = int

但我想做的是:

plt.ylabel('Text 1', fontsize1=20, 'Text 2', fontsize2=15)

matplotlib / seaborn 有没有办法做到这一点?

谢谢

您可以做的一件事是使用 LaTeX 在同一字符串中获得不同的大小:

plt.rc('text', usetex=True)
plt.ylabel(r'\small{Text 1} \Huge{Text2}')