I have a 3D numpy array of shape (64,200,200). I want to plot a series of 2D histograms iterating along the 1st axis, i.e. I want a 2D histogram for each (200x200) slice. I have tried with :
for i in range(len(a1)-1): #a1 is the array in question
plt.hist2d(a1[i,:,0],a1[i,0,:])
plt.show()
However, I want to loop along the 1st axis and store each 2D array slice in an array series with names b1,b2,b3,...b64 which can be produced in the loop itself (it is difficult to do so manually). Then using imshow I can plot the desired arrays or even loop along the entire series.
Kindly suggest if this is feasible or there is a more efficient way of doing this.
Thanks in advance.