pyplot.subplots
creates a figure and a grid of subplots with a single call,while providing reasonable control over how the individual plots are created.For more advanced use cases you can use GridSpec
for a more general subplotlayout or Figure.add_subplot
for adding subplots at arbitrary locationswithin the figure.pyplot.subplots
define the number ofrows and columns of the subplot grid.axs
is a 1D numpy arraycontaining the list of created Axes.ax1
instead ofthe more verbose axs[0]
.1,2
for one row and twocolumns.axs
is a 2D numpy array.foraxinaxs.flat:
.True
enables global sharing across thewhole grid, i.e. also the y-axes of vertically stacked subplots have thesame scale when using sharey=True
.pyplot.subplots
controls the gridproperties (see also GridSpec
). For example, we can reduce the heightbetween vertical subplots using gridspec_kw={'hspace':0}
.label_outer
is a handy method to remove labels and ticks from subplotsthat are not at the edge of the grid.True
and False
, both sharex and sharey accept thevalues 'row' and 'col' to share the values only per row or column. Noteburner itunes drm audio converter 2 4 3.pyplot.subplots
controls the subplotproperties (see also Figure.add_subplot
). Pcalc 4 0 2 – full featured scientific calculator. In particular, this can be usedto create a grid of polar Axes.