markusian markusian - 7 months ago 89
Python Question

Centered text in matplotlib tables

I am trying to center the text inside a matplotlib table cell, while the default seems to be right aligned. I looked through the documentation of the Table object, but I could not find anything useful in this.

Is there an easy way to achieve the centering?


Try editing the sample here




the_table = plt.table(cellText=cell_text, rowLabels=rows, rowColours=colors, colLabels=columns, loc='bottom')

To get enter image description here