You need to get text font properties of the cells:
import matplotlib.pyplot as plt
table=plt.table(cellText=[' ', ' ', ' ', ' ', ' '], #rows of data values
rowLabels=['1','2','3','4','5'],
cellLoc="left",
rowLoc='left',
bbox=[0,0,.2,1],#[left,bottom,width,height]
edges="")
# iterate through cells of a table
table_props = table.properties()
table_cells = table_props['child_artists']
for cell in table_cells:
cell.get_text().set_fontsize(20)
cell.get_text().set_color('grey')
plt.show()
Another method to get text properties of the cell is used cell indexes (i, j):
table[(i, j)].get_text().set_fontsize(12)
table[(i, j)].get_text().set_color('red')
Matplotlib text font properties are described here: http://matplotlib.org/api/text_api.html#matplotlib.text.Text.set_fontproperties
As a result, the first code draw this figure:
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…