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,
)
| 140 | |
| 141 | |
| 142 | def 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 |
no test coverage detected