【发布时间】:2013-04-23 15:43:24
【问题描述】:
我已经设法使用hist2d 和ImageGrid 制作了一组子图,代码如下:
from mpl_toolkits.axes_grid1 import ImageGrid
fig = figure(figsize(20, 60))
grid = ImageGrid(fig, 111, nrows_ncols=(1, 3), axes_pad=0.25)
for soa, ax in zip(soalist, grid):
# grab my data from pandas DataFrame...
samps = allsubs[allsubs['soa'] == soa]
x, y = samps['x'], samps['y']
# calls hist2d and returns the Image returned by hist2d
img = gazemap(x, y, ax, std=True, mean=True)
ax.set_title("{0} ms".format(soa * 1000))
# attempt to show a colorbar for that image
grid.cbar_axes[-1].colorbar(img)
show() # threw this in for good measure, but doesn't help!
我没有收到明显的错误(这很好,因为我将 Image 传递给了 colorbar),但我的颜色条没有出现。什么给了?
【问题讨论】:
标签: matplotlib colorbar