@@ -712,40 +712,32 @@ def figure(num=None, # autoincrement if None, else integer from 1-N
712
712
If False, suppress drawing the figure frame.
713
713
714
714
FigureClass : subclass of `~matplotlib.figure.Figure`
715
- Optionally use a custom `.Figure` instance.
715
+ If set, an instance of this subclass will be created, rather than a
716
+ plain `.Figure`.
716
717
717
718
clear : bool, default: False
718
719
If True and the figure already exists, then it is cleared.
719
720
720
- tight_layout : bool or dict, default: :rc:`figure.autolayout`
721
- If ``False`` use *subplotpars*. If ``True`` adjust subplot
722
- parameters using `.tight_layout` with default padding.
723
- When providing a dict containing the keys ``pad``, ``w_pad``,
724
- ``h_pad``, and ``rect``, the default `.tight_layout` paddings
725
- will be overridden .
721
+ layout : {'constrained', 'tight', `.LayoutEngine`, None}, default: None
722
+ The layout mechanism for positioning of plot elements to avoid
723
+ overlapping Axes decorations (labels, ticks, etc). Note that layout
724
+ managers can measurably slow down figure display. Defaults to *None*
725
+ (but see the documentation of the `.Figure` constructor regarding the
726
+ interaction with rcParams) .
726
727
727
- constrained_layout : bool, default: :rc:`figure.constrained_layout.use`
728
- If ``True`` use constrained layout to adjust positioning of plot
729
- elements. Like ``tight_layout``, but designed to be more
730
- flexible. See
731
- :doc:`/tutorials/intermediate/constrainedlayout_guide`
732
- for examples. (Note: does not work with `add_subplot` or
733
- `~.pyplot.subplot2grid`.)
734
-
735
-
736
- **kwargs : optional
737
- See `~.matplotlib.figure.Figure` for other possible arguments.
728
+ **kwargs
729
+ Additional keyword arguments are passed to the `.Figure` constructor.
738
730
739
731
Returns
740
732
-------
741
733
`~matplotlib.figure.Figure`
742
- The `.Figure` instance returned will also be passed to
743
- new_figure_manager in the backends, which allows to hook custom
744
- `.Figure` classes into the pyplot interface. Additional kwargs will be
745
- passed to the `.Figure` init function.
746
734
747
735
Notes
748
736
-----
737
+ Newly created figures will be passed to the
738
+ `~.backend_template.new_figure_manager` function provided by the current
739
+ backend, which will install a canvas and a manager on the figure.
740
+
749
741
If you are creating many figures, make sure you explicitly call
750
742
`.pyplot.close` on the figures you are not using, because this will
751
743
enable pyplot to properly clean up the memory.
0 commit comments