This should be really simple but for some reason I can't get it to work:
def plot_image(images, heatmaps):
plt.figure(0)
for i, (image, map) in enumerate(zip(images, heatmaps)):
a = plt.subplot2grid((2,4), (0,i))
a.imshow(image)
a = plt.subplot2grid((2,4), (1,i))
a.imshow(map)
plt.colorbar(a, fraction=0.046, pad=0.04)
plt.show()
The values in colorbar line are taken from here, but I'm getting:
AttributeError: 'AxesSubplot' object has no attribute 'autoscale_None'
I'm plotting 2 by 4 grid of images, and I'd like to display vertical colorbars to the right from each image, or perhaps only next to the rightmost images in the grid.