I am struggling to make the text in matplotlib to have the same visual length after filling space. It always doesn't work for me.
Here is what I have tried,
from matplotlib import pyplot as plt
fig = plt.figure()
plt.text(0,1,'how are you', bbox=dict(facecolor='red', alpha=0.5))
plt.text(0,0,'how'.ljust(len('how are you'), bbox=dict(facecolor='red', alpha=0.5))
plt.show()
And ideas?
Thanks!