MCPcopy
hub / github.com/pandas-dev/pandas / create_subplots

Function create_subplots

pandas/plotting/_matplotlib/tools.py:142–323  ·  view source on GitHub ↗

Create a figure with a set of subplots already made. This utility wrapper makes it convenient to create common layouts of subplots, including the enclosing figure object, in a single call. Parameters ---------- naxes : int Number of required axes. Exceeded axes are s

(
    naxes: int,
    sharex: bool = False,
    sharey: bool = False,
    squeeze: bool = True,
    subplot_kw=None,
    ax=None,
    layout=None,
    layout_type: str = "box",
    **fig_kw,
)

Source from the content-addressed store, hash-verified

140
141
142def create_subplots(
143 naxes: int,
144 sharex: bool = False,
145 sharey: bool = False,
146 squeeze: bool = True,
147 subplot_kw=None,
148 ax=None,
149 layout=None,
150 layout_type: str = "box",
151 **fig_kw,
152):
153 """
154 Create a figure with a set of subplots already made.
155
156 This utility wrapper makes it convenient to create common layouts of
157 subplots, including the enclosing figure object, in a single call.
158
159 Parameters
160 ----------
161 naxes : int
162 Number of required axes. Exceeded axes are set invisible. Default is
163 nrows * ncols.
164
165 sharex : bool
166 If True, the X axis will be shared amongst all subplots.
167
168 sharey : bool
169 If True, the Y axis will be shared amongst all subplots.
170
171 squeeze : bool
172
173 If True, extra dimensions are squeezed out from the returned axis object:
174 - if only one subplot is constructed (nrows=ncols=1), the resulting
175 single Axis object is returned as a scalar.
176 - for Nx1 or 1xN subplots, the returned object is a 1-d numpy object
177 array of Axis objects are returned as numpy 1-d arrays.
178 - for NxM subplots with N>1 and M>1 are returned as a 2d array.
179
180 If False, no squeezing is done: the returned axis object is always
181 a 2-d array containing Axis instances, even if it ends up being 1x1.
182
183 subplot_kw : dict
184 Dict with keywords passed to the add_subplot() call used to create each
185 subplots.
186
187 ax : Matplotlib axis object, optional
188
189 layout : tuple
190 Number of rows and columns of the subplot grid.
191 If not specified, calculated from naxes and layout_type
192
193 layout_type : {'box', 'horizontal', 'vertical'}, default 'box'
194 Specify how to layout the subplot grid.
195
196 fig_kw : Other keyword arguments to be passed to the figure() call.
197 Note that all keywords not recognized above will be
198 automatically included here.
199

Callers 6

_axes_and_figMethod · 0.90
scatter_matrixFunction · 0.90
_grouped_plot_by_columnFunction · 0.90
boxplot_frame_groupbyFunction · 0.90
_grouped_plotFunction · 0.90
hist_frameFunction · 0.90

Calls 9

find_stack_levelFunction · 0.90
flatten_axesFunction · 0.85
_get_layoutFunction · 0.85
handle_shared_axesFunction · 0.85
clearMethod · 0.80
squeezeMethod · 0.80
emptyMethod · 0.45
copyMethod · 0.45
reshapeMethod · 0.45

Tested by

no test coverage detected