That's not how subplot indexing works. From the docs to subplot:
subplot(nrows, ncols, plot_number)
Where nrows and ncols are used to notionally split the figure into
nrows * ncolssub-axes, and plot_number is used to identify the particular subplot that this function is to create within the notional grid. plot_number starts at 1, increments across rows first and has a maximum ofnrows * ncols.
So, you want to have nrows=8, ncols=8 and then a plot_number in the range 1-64, so something like:
nrows,ncols = 8,8 for y in range(8): for x in range(8): plot_number = 8*y + x + 1 subplot(nrows,ncols,plot_number) plot(time,H[x,y,:]) # Remove tick labels if not on the bottom/left of the grid if y<7: gca().set_xticklabels([]) if x>0: gca().set_yticklabels([]) To remove tick labels, use gca() to get the current axes, and the set the xticklabels and yticklabels to an empty list: []