Matplotlib 为什么不是';我的颜色条是否出现在这个ImageGrid绘图中?

Matplotlib 为什么不是';我的颜色条是否出现在这个ImageGrid绘图中?,matplotlib,colorbar,Matplotlib,Colorbar,我使用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...

我使用
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!
我没有得到明确的错误(这很好,因为我将
图像
传递给
颜色栏
),但我的颜色栏没有出现。有什么用?

好的,我修好了

我所要做的就是将
cbar_模式
cbar_位置
kwargs传递到
ImageGrid