For a multi-character subscript in Matplotlib, we should put all the characters inside curly braces. For example, if we want 123 as a subscript of N, we should use $N_{123}$. This is working fine as long as I am giving the subscript explicitly. But, my subscript is a variable (say, sub=123). So, when I use the format string method (shown below), all except the first character appear in normal size (shown in the figure).
sub = 123
plt.title("$N_{}$".format(sub))

I had a similar issue, this worked out for me:
title(r'Diffused Field for $\theta_{{out}}$ = {}°'.format(round(theta_out/pi*180,3)))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With