fig, axs = plt.subplots()
returns a figure with only one single subplot, so axs already holds it without indexing.
fig, axs = plt.subplots(3)
returns a 1D array of subplots.
fig, axs = plt.subplots(3, 2)
returns a 2D array of subplots.
Note that this is only due to the default setting of the kwarg squeeze=True.
By setting it to False
you can force the result to be a 2D-array, independant of the number or arrangement of the subplots.