我使用以下图创建了mpl_toolkits.axes_grid1
:
但是,出于某种原因,我的子情节标题没有出现。我该如何解决这个问题?
代码:
# import
from mpl_tookits.axes_grid1 import ImageGrid
from matplotlib.pyplot import *
fig = figure(figsize=(20, 12), dpi=300)
grid = ImageGrid(fig, 111, nrows_ncols=(3, 4), axes_pad=1, aspect=False)
for gridax, (i, sub) in zip(grid, enumerate(eyelink_data)):
subnum = i + start_with
# format data
xdat = sub['x'][(sub['in_trl'] == True) & (sub['x'].notnull()) & (sub['y'].notnull())]
ydat = sub['y'][(sub['in_trl'] == True) & (sub['x'].notnull()) & (sub['y'].notnull())]
# plot
gridax.hist2d(xdat, ydat, bins=[np.linspace(-.005, .005, num=1000), np.linspace(-.005, .005, num=1000)])
gridax.plot(0, 0, 'ro') # origin
title('Subject {0} in-Trial Gaze'.format(subnum))
xlabel('Horizontal Offset\n(degrees visual angle)')
ylabel('Vertical Offset\n(degrees visual angle)')
show()
PS:享受网格错觉!