matplotlib 3.5.1

Other ParametersParameters
__init__(self, figsize=None, dpi=None, facecolor=None, edgecolor=None, linewidth=0.0, frameon=None, subplotpars=None, tight_layout=None, constrained_layout=None, *, layout=None, **kwargs)

Other Parameters

**kwargs : `.Figure` properties, optional

Properties: agg_filter: a filter function, which takes a (m, n, 3) float array and a dpi value, and returns a (m, n, 3) array alpha: scalar or None animated: bool canvas: FigureCanvas clip_box: .Bbox clip_on: bool clip_path: Patch or (Path, Transform) or None constrained_layout: bool or dict or None constrained_layout_pads: float, default: figure.constrained_layout.w_pad dpi: float edgecolor: color facecolor: color figheight: float figure: .Figure figwidth: float frameon: bool gid: str in_layout: bool label: object linewidth: number path_effects: .AbstractPathEffect picker: None or bool or float or callable rasterized: bool size_inches: (float, float) or float sketch_params: (scale: float, length: float, randomness: float) snap: bool or None tight_layout: bool or dict with keys "pad", "w_pad", "h_pad", "rect" or None transform: .Transform url: str visible: bool zorder: float

Parameters

figsize : 2-tuple of floats, default: :rc:`figure.figsize`

Figure dimension (width, height) in inches.

dpi : float, default: :rc:`figure.dpi`

Dots per inch.

facecolor : default: :rc:`figure.facecolor`

The figure patch facecolor.

edgecolor : default: :rc:`figure.edgecolor`

The figure patch edge color.

linewidth : float

The linewidth of the frame (i.e. the edge linewidth of the figure patch).

frameon : bool, default: :rc:`figure.frameon`

If False , suppress drawing the figure background patch.

subplotpars : `SubplotParams`

Subplot parameters. If not given, the default subplot parameters figure.subplot.* are used.

tight_layout : bool or dict, default: :rc:`figure.autolayout`

Whether to use the tight layout mechanism. See .set_tight_layout .

.. admonition:: Discouraged
    The use of this parameter is discouraged. Please use
    ``layout='tight'`` instead for the common case of
    ``tight_layout=True`` and use `.set_tight_layout` otherwise.
constrained_layout : bool, default: :rc:`figure.constrained_layout.use`

This is equal to layout='constrained' .

.. admonition:: Discouraged
    The use of this parameter is discouraged. Please use
    ``layout='constrained'`` instead.
layout : {'constrained', 'tight'}, optional

The layout mechanism for positioning of plot elements. Supported values:

  • 'constrained': The constrained layout solver usually gives the best layout results and is thus recommended. However, it is computationally expensive and can be slow for complex figures with many elements.

    See /tutorials/intermediate/constrainedlayout_guide for examples.

  • 'tight': Use the tight layout mechanism. This is a relatively simple algorithm, that adjusts the subplot parameters so that decorations like tick labels, axis labels and titles have enough space. See .Figure.set_tight_layout for further details.

If not given, fall back to using the parameters tight_layout and constrained_layout, including their config defaults figure.autolayout and figure.constrained_layout.use .

Examples

See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /matplotlib/figure.py#2154
type: <class 'function'>
Commit: