

It will return an array of axes handles (1D array if creating a single column or row, 2D array if there is more than one row and more than one column).

The two main arguments for plt.subplots(nrows, ncols) will establish how many rows and columns you want to break the figure into.plt.subplots() allows you to create the figure and the axes handles at the same time.This method can be especially useful if you want to build a figure with several non-overlapping subplots of different shapes - more on that below. The three main arguments for fig.add_subplot(nrows, ncols, index) will establish how many rows and columns you want to break the figure into and then which one of those subplots you want to work with.fig.add_subplot() needs you to create the figure handle first (probably with fig=plt.figure() and then you can use that figure variable to create one set of axes within an array of axes.There are three different ways to create subplots:

5 Multiple Rows and Columns of Subplots.4 Single Column of Subplots with Shared x Axis.
