I am trying to create a text box with LaTeX code lines correctly aligned in the frame matplotlib. I tried using the format alignment method (i.e. {:<11}), but it does not work in math mode.
Here's the output I get:

where the characters =should be aligned to the right (see below MWE).
How can I create such a text box with correctly aligned characters =?
MWE
(Donβt pay attention to the strange proportions of the shapes and the placement of the text field, this is part of the much larger code that I cut to create this MWE)
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import matplotlib.offsetbox as offsetbox
fig = plt.figure(figsize=(30, 25))
gs = gridspec.GridSpec(10, 12)
ax_t = plt.subplot(gs[4:6, 10:12])
cp_r = [0.001, 8.3, 0.18, 15.2, 5000, 0.3]
cp_e = [0.0005, 0.2, 0.11, 0.3, 200, 0.1]
ax_t.axis('off')
text2 = r'{:<11}'.format('$y$') + \
r'$=\, {} \pm {}$'.format(cp_r[0], cp_e[0])
text3 = r'{:<11}'.format('$log(ret)$') + \
r'$=\, {} \pm {}$'.format(cp_r[1], cp_e[1])
text4 = r'{:<11}'.format('$A_{{(B-C)}}$') + \
r'$=\, {} \pm {}$'.format(cp_r[2], cp_e[2])
text5 = r'{:<11}'.format('$(n-N)_o$') + \
r'$=\, {} \pm {}$'.format(cp_r[3], cp_e[3])
text6 = r'{:<11}'.format('$K_{{\odot}}$') + \
r'$=\, {} \pm {}$'.format(cp_r[4], cp_e[4])
text7 = r'{:<11}'.format('$d_{{frac}}$') + \
r'$=\, {} \pm {}$'.format(cp_r[5], cp_e[5])
text = text2 + '\n' + text3 + '\n' + text4 + '\n' + text5 + '\n' + text6 + \
'\n' + text7
ob = offsetbox.AnchoredText(text, pad=1, loc=6, prop=dict(size=13))
ob.patch.set(alpha=0.85)
ax_t.add_artist(ob)
plt.savefig('out.png', dpi=300)