I'm trying to use a for lop to populate a subplot but I can't do so. here is a summary of my code: Edit 1:
for idx in range(8):
img = f[img_set[ind[idx]][0]]
patch = img[:,col1+1:col2, row1+1:row2]
if idx < 3:
axarr[0,idx] = plt.imshow(patch)
elif idx <6:
axarr[1,idx-3] = plt.imshow(patch)
else:
axarr[2,idx-6] = plt.imshow(patch)
path_ = 'plots/test' + str(k) + '.pdf'
fig.savefig(path_)
It only plots an image on the 3rd row and 3rd column the rest of the plot is blank. How can I change that?