I want to put two lines of text with some numbers on a plot. It works perfectly (Example 1).
However, I need some of the text to be superscript.
When I use $^{text}$ my \n newline character seems to get bigger, which breaks my alignment in the plot as in Example 2. The difference isn't much, but it is enough to be causing me problems.
Is there any way I can keep the original spacing of the newline character and also include superscript formatting? I know there are a few posts on similar topics, but mainly cover the use of raw strings rather than the size of the newline itself.
A simple and complete example:
import matplotlib.pyplot as plt
n=100
#Example 1
plt.text(0,0.01,'Hello: '+str(n)+'\n'+'TEST')
#Example 2
plt.text(0.2,0.01,'Hello: '+str(n)+'\n'+r'TEST1$^{problem}$')
