matplotlib.figure.SubFigure#

classmatplotlib.figure.SubFigure(parent,subplotspec,*,facecolor=None,edgecolor=None,linewidth=0.0,frameon=None,**kwargs)[source]#

Logical figure that can be placed inside a figure.

SeeSubFigure for an index of methods on this class.Typically instantiated usingFigure.add_subfigure orSubFigure.add_subfigure, orSubFigure.subfigures. A subfigure hasthe same methods as a figure except for those particularly tied to the sizeor dpi of the figure, and is confined to a prescribed region of the figure.For example the following puts two subfigures side-by-side:

fig=plt.figure()sfigs=fig.subfigures(1,2)axsL=sfigs[0].subplots(1,2)axsR=sfigs[1].subplots(2,1)

SeeFigure subfigures

Parameters:
parentFigure orSubFigure

Figure or subfigure that contains the SubFigure. SubFigurescan be nested.

subplotspecgridspec.SubplotSpec

Defines the region in a parent gridspec where the subfigure willbe placed.

facecolordefault:"none"

The figure patch face color; transparent by default.

edgecolordefault:rcParams["figure.edgecolor"] (default:'white')

The figure patch edge color.

linewidthfloat

The linewidth of the frame (i.e. the edge linewidth of the figurepatch).

frameonbool, default:rcParams["figure.frameon"] (default:True)

IfFalse, suppress drawing the figure background patch.

Other Parameters:
**kwargsSubFigure properties, optional

Property

Description

agg_filter

a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array and two offsets from the bottom left corner of the image

alpha

float or None

animated

bool

clip_box

BboxBase or None

clip_on

bool

clip_path

Patch or (Path, Transform) or None

dpi

float

edgecolor

color

facecolor

color

figure

unknown

frameon

bool

gid

str

in_layout

bool

label

object

linewidth

number

mouseover

bool

path_effects

list ofAbstractPathEffect

picker

None or bool or float or callable

rasterized

bool

sketch_params

(scale: float, length: float, randomness: float)

snap

bool or None

transform

Transform

url

str

visible

bool

zorder

float

On this page