2013-04-23 20 views
0

我已經成功使用hist2dImageGrid與下面的代碼,以使一組次要情節:爲什麼我的顏色條不出現在這個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! 

我沒有得到任何明確的錯誤(這是很好的,因爲我通過一個Imagecolorbar),但我的彩條不會出現。是什麼賦予了?

回答

1

好的,我修好了!

我所要做的就是通過cbar_modecbar_location kwargs到ImageGrid

相關問題