I have a 3-D array ar.
print shape(ar) # --> (81, 81, 256)
I want to plot this array.
fig = plt.figure()
ax1 = fig.add_subplot(111)
for i in arange(256):
im1 = ax1.imshow(ar[:][:][i])
plt.draw()
print i
I get this error-message:
im1 = ax1.imshow(ar[:][:][i])
IndexError: list index out of range
Why do I get this strange message? The graph has the size 81 x 256 and not like expected 81 x 81. But why?
Do:
The syntax
ar[:]makes a copy ofar(slices all its elements), soar[:][:][i]is semantically equivalent toar[i]. This is an 81*256 matrix, since ndarrays are nested lists.