smpl.plot.figure¶
- smpl.plot.figure(num=None, figsize=None, dpi=None, *, facecolor=None, edgecolor=None, frameon=True, FigureClass=<class 'matplotlib.figure.Figure'>, clear=False, **kwargs)[source]¶
Create a new figure, or activate an existing figure.
Parameters¶
- numint or str or .Figure or .SubFigure, optional
A unique identifier for the figure.
If a figure with that identifier already exists, this figure is made active and returned. An integer refers to the
Figure.numberattribute, a string refers to the figure label.If there is no figure with the identifier or num is not given, a new figure is created, made active and returned. If num is an int, it will be used for the
Figure.numberattribute, otherwise, an auto-generated integer value is used (starting at 1 and incremented for each new figure). If num is a string, the figure label and the window title is set to this value. If num is aSubFigure, its parentFigureis activated.- figsize(float, float), default: :rc:`figure.figsize`
Width, height in inches.
- dpifloat, default: :rc:`figure.dpi`
The resolution of the figure in dots-per-inch.
- facecolorcolor, default: :rc:`figure.facecolor`
The background color.
- edgecolorcolor, default: :rc:`figure.edgecolor`
The border color.
- frameonbool, default: True
If False, suppress drawing the figure frame.
- FigureClasssubclass of ~matplotlib.figure.Figure
If set, an instance of this subclass will be created, rather than a plain .Figure.
- clearbool, default: False
If True and the figure already exists, then it is cleared.
- layout{‘constrained’, ‘tight’, .LayoutEngine, None}, default: None
The layout mechanism for positioning of plot elements to avoid overlapping Axes decorations (labels, ticks, etc). Note that layout managers can measurably slow down figure display. Defaults to None (but see the documentation of the .Figure constructor regarding the interaction with rcParams).
- **kwargs
Additional keyword arguments are passed to the .Figure constructor.
Returns¶
~matplotlib.figure.Figure
Notes¶
Newly created figures are passed to the ~.FigureCanvasBase.new_manager method or the new_figure_manager function provided by the current backend, which install a canvas and a manager on the figure.
If you are creating many figures, make sure you explicitly call .pyplot.close on the figures you are not using, because this will enable pyplot to properly clean up the memory.
~matplotlib.rcParams defines the default values, which can be modified in the matplotlibrc file.