By default, matplotlib subplots are filled by row, not by column. To clarify, the commands
plt.subplot(nrows=3, ncols=2, idx=2)
plt.subplot(nrows=3, ncols=2, idx=3)
first plot into the upper right plot of the 3x2 plot grid (idx=2), and then into the middle left plot (idx=3).
Sometimes it may be desirable for whatever reason to fill the subplots by row, not by column (for example, because directly consecutive plots belong together and are easier interpretable when positioned below each other, rather than next to each other). How can this be achieved?