I am trying to use the tab character in pyplot. However, the tab character is displaying a square, not the tab space I require.
My code is:
fig = pl.figure()
fig.text(.1,.05, "test \t test", bbox=dict(facecolor='red', alpha=0.5))
Does anyone know why this doesn’t work?
I was surprised that
pylab.showactually shows some spaces in place of your square. Butsavefigdoes not try to be smart and gives what you describe. Now, how many spaces does one tab take ? This question makes no sense. Is it 4 for you ? I will pick 4.2 for me. This means you need to decide how many spaces you want a tab to take in your text, i.e.:Or, maybe you want to simply expand your tabs using “standard” conventions: