in [ ]axes out[ ]array([[axes( , ; )axes( , ; )axes( , ; )][axes( , ; )axes( , ; )axes( , ; )]]dtype=objectthis is very useful as the axes array can be easily indexed like two-dimensional arrayfor exampleaxes[ you can also indicate that subplots should have the same or axis using sharex and shareyrespectively this is especially useful when comparing data on the same scaleotherwisematplotlib auto-scales plot limits independently see table - for more on this method table - pyplot subplots options argument description nrows number of rows of subplots ncols number of columns of subplots sharex all subplots should use the same -axis ticks (adjusting the xlim will affect all subplotssharey all subplots should use the same -axis ticks (adjusting the ylim will affect all subplotssubplot_kw dict of keywords for creating the **fig_kw additional keywords to subplots are used when creating the figuresuch as plt subplots( figsize=( )adjusting the spacing around subplots by default matplotlib leaves certain amount of padding around the outside of the subplots and spacing between subplots this spacing is all specified relative to the height and width of the plotso that if you resize the plot either programmatically or manually using the gui windowthe plot will dynamically adjust itself the spacing can be most easily changed using the subplots_adjust figure methodalso available as top-level functionsubplots_adjust(left=nonebottom=noneright=nonetop=nonewspace=nonehspace=nonewspace and hspace controls the percent of the figure width and figure heightrespectivelyto use as spacing between subplots here is small example where shrink the spacing all the way to zero (see figure - )figaxes plt subplots( sharex=truesharey=truefor in range( )for in range( )axes[ijhist(randn( )bins= color=' 'alpha= plt subplots_adjust(wspace= hspace= brief matplotlib api primer www it-ebooks info