使用matplotlib python

时间:2017-07-06 16:34:26

标签: python matplotlib

我已经搜索了解决方案,而我似乎无法找到解决问题的方法。我有4张图,我想在每张图中放一张表。从截图。左上图几乎是我想要的,但它不易阅读。有没有办法让字体更大?就像左下方图表一样大。我的代码也在下面

Picture 4 graphs

import os, math, time
import matplotlib.animation as animation     
import matplotlib.pyplot as plt
from ipython_genutils.py3compat import xrange

fig = plt.figure()
fig_size = plt.rcParams["figure.figsize"]
print(fig_size)
fig_size[0] =12
fig_size[1] =12
plt.rcParams["figure.figsize"] = fig_size
print(fig_size)

fig.patch.set_facecolor('gray')
ax1 = plt.subplot2grid((12,2), (0,0), rowspan=6, colspan=1)
ax2 = plt.subplot2grid((12,2), (0,1), rowspan=6, colspan=1)
ax3 = plt.subplot2grid((12,2), (8,0), rowspan=4, colspan=1)
ax4 = plt.subplot2grid((12,2), (8,1), rowspan=4, colspan=1)

ax1.text(12,3.4,'Table Title',size = 20)
ax1.table(cellText=Table,rowLabels=rows, colLabels=columns,loc='center right',colWidths = [0.1]*3) #adds table to graph
#the lines commented out below are things I tried.
atable2 = ax2.table(cellText=Table2,rowLabels=rows, colLabels=columns,loc='center right', colWidths = [0.1]*3, fontsize = 24) #, bbox=[0.0,-.58,1,.38]
#atable2.set_fontsize(100)
#atable2.auto_set_font_size(True)
#plt.text(12,3.4,'Table Title',size = 20)
atable2.scale(1, 2)

ax3.table(cellText=Table3,rowLabels=rows, colLabels=columns,loc='bottom', bbox=[0.0,-.85,1,.55]) #.28

0 个答案:

没有答案