'numpy.ndarray' object has no attribute 'imshow'
This:
for i in ax:
ax[i].imshow(img, interpolation='none')
doesn't make sense because I
isn't the index. It's one of the axis objects.
And your first case is wrong because even though you loop over the items, you call the function on ax
, not the individual axes.
Do this:
for a in ax:
a.imshow(img, interpolation='none')
just add this command before "ax.flatten()" before your code
ax = ax.flatten()
for a in ax:
a.imshow(img, interpolation='none')
plt.show()