Jul-12-2017, 06:52 PM
Hi,
I'm fighting for hours to change the size of the numbers which fills the cells of a table created with matplotlib. Here's my code for a subplot table:
If anyone could show me how to change the font size, it would be super helpful.
I'm fighting for hours to change the size of the numbers which fills the cells of a table created with matplotlib. Here's my code for a subplot table:
rows = ['%d' % i for i in np.arange(1,prism+1)] columns = ('Mt (A)','inc ($^\circ$)','x0 (m)','z0 (m)') prec = np.asarray(data_prec) cell_text = [] for row in range(prism): cell_text.append(['%.1f $\pm$ %.1f' % item for item in zip(p[row,0:4],prec[row,0:4])]) ax6=plt.subplot2grid((3,3), (2,2), colspan=1, frameon=False) ax6.table(cellText=cell_text,rowLabels=rows,colLabels=columns,loc='center') ax6.get_xaxis().set_visible(False) ax6.get_yaxis().set_visible(False) ax6.set_title('f)', fontsize=12, fontweight="bold", position=(-0.05,0.85)) plt.show()I also tried to use fontsize on line 10 of the code, but without success. At this moment the code creates a table using the arrays "p" and "prec". Everything is ok, except by the fact of the table font has size like 6 or 8, too small for my necessity.
If anyone could show me how to change the font size, it would be super helpful.