【发布时间】:2017-12-23 08:51:26
【问题描述】:
这应该很简单,但由于某种原因我无法让它工作:
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()
颜色条行中的值取自here,但我得到:
AttributeError: 'AxesSubplot' 对象没有属性 'autoscale_None'
我正在绘制 2 x 4 网格的图像,我想在每个图像的右侧显示垂直颜色条,或者可能只在网格中最右边的图像旁边显示。
【问题讨论】:
标签: python matplotlib subplot colormap