MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / SubFigure

Class SubFigure

lib/matplotlib/figure.py:2223–2427  ·  view source on GitHub ↗

Logical figure that can be placed inside a figure. See :ref:`figure-api-subfigure` for an index of methods on this class. Typically instantiated using `.Figure.add_subfigure` or `.SubFigure.add_subfigure`, or `.SubFigure.subfigures`. A subfigure has the same methods as a figur

Source from the content-addressed store, hash-verified

2221
2222@_docstring.interpd
2223class SubFigure(FigureBase):
2224 """
2225 Logical figure that can be placed inside a figure.
2226
2227 See :ref:`figure-api-subfigure` for an index of methods on this class.
2228 Typically instantiated using `.Figure.add_subfigure` or
2229 `.SubFigure.add_subfigure`, or `.SubFigure.subfigures`. A subfigure has
2230 the same methods as a figure except for those particularly tied to the size
2231 or dpi of the figure, and is confined to a prescribed region of the figure.
2232 For example the following puts two subfigures side-by-side::
2233
2234 fig = plt.figure()
2235 sfigs = fig.subfigures(1, 2)
2236 axsL = sfigs[0].subplots(1, 2)
2237 axsR = sfigs[1].subplots(2, 1)
2238
2239 See :doc:`/gallery/subplots_axes_and_figures/subfigures`
2240 """
2241
2242 def __init__(self, parent, subplotspec, *,
2243 facecolor=None,
2244 edgecolor=None,
2245 linewidth=0.0,
2246 frameon=None,
2247 **kwargs):
2248 """
2249 Parameters
2250 ----------
2251 parent : `.Figure` or `.SubFigure`
2252 Figure or subfigure that contains the SubFigure. SubFigures
2253 can be nested.
2254
2255 subplotspec : `.gridspec.SubplotSpec`
2256 Defines the region in a parent gridspec where the subfigure will
2257 be placed.
2258
2259 facecolor : default: ``"none"``
2260 The figure patch face color; transparent by default.
2261
2262 edgecolor : default: :rc:`figure.edgecolor`
2263 The figure patch edge color.
2264
2265 linewidth : float
2266 The linewidth of the frame (i.e. the edge linewidth of the figure
2267 patch).
2268
2269 frameon : bool, default: :rc:`figure.frameon`
2270 If ``False``, suppress drawing the figure background patch.
2271
2272 Other Parameters
2273 ----------------
2274 **kwargs : `.SubFigure` properties, optional
2275
2276 %(SubFigure:kwdoc)s
2277 """
2278 super().__init__(**kwargs)
2279 if facecolor is None:
2280 facecolor = "none"

Callers 1

add_subfigureMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…