(towns_n and Towns are two arrays each with 50 numbers and names respectively)
count = 0
for number,town in zip(towns_n,Towns):
textString += (number +'.'+ town).ljust(35)
count += 1
if count == 6:
count = 0
textString += '\n'
plt.figtext(0.13,0.078,textString)
My problem is that I want to plot 6 columns.
And if I print my string it looks exactly as expected, it looks like 6 aligned columns. But if I plot it along my other image it doesn't look aligned at all.
I don't think it matters but my other image is a map usign basemap. I am plotting this string just below my map.
Edit: You can try this to generate 50 random strings and numbers so that you don't need the actual list of towns.
def id_generator(size=6, chars=string.ascii_uppercase + string.digits):
return ''.join(random.choice(chars) for _ in range(size))
Towns=[]
towns_n=[]
for i in range(50):
string = id_generator()
Towns.append(string);
towns_n.append(str(i))

