@@ -184,7 +184,7 @@ class FigureBase(Artist):
184
184
Base class for `.figure.Figure` and `.figure.SubFigure` containing the
185
185
methods that add artists to the figure or subfigure, create Axes, etc.
186
186
"""
187
- def __init__ (self ):
187
+ def __init__ (self , ** kwargs ):
188
188
super ().__init__ ()
189
189
# remove the non-figure artist _axes property
190
190
# as it makes no sense for a figure to be _in_ an axes
@@ -217,6 +217,7 @@ def __init__(self):
217
217
self .subfigs = []
218
218
self .stale = True
219
219
self .suppressComposite = None
220
+ self .set (** kwargs )
220
221
221
222
def _get_draw_artists (self , renderer ):
222
223
"""Also runs apply_aspect"""
@@ -1923,6 +1924,7 @@ def _set_artist_props(self, a):
1923
1924
a .set_transform (self .transSubfigure )
1924
1925
1925
1926
1927
+ @docstring .interpd
1926
1928
class SubFigure (FigureBase ):
1927
1929
"""
1928
1930
Logical figure that can be placed inside a figure.
@@ -1945,7 +1947,8 @@ def __init__(self, parent, subplotspec, *,
1945
1947
facecolor = None ,
1946
1948
edgecolor = None ,
1947
1949
linewidth = 0.0 ,
1948
- frameon = None ):
1950
+ frameon = None ,
1951
+ ** kwargs ):
1949
1952
"""
1950
1953
Parameters
1951
1954
----------
@@ -1969,8 +1972,14 @@ def __init__(self, parent, subplotspec, *,
1969
1972
1970
1973
frameon : bool, default: :rc:`figure.frameon`
1971
1974
If ``False``, suppress drawing the figure background patch.
1975
+
1976
+ Other Parameters
1977
+ ----------------
1978
+ **kwargs : `.SubFigure` properties, optional
1979
+
1980
+ %(SubFigure:kwdoc)s
1972
1981
"""
1973
- super ().__init__ ()
1982
+ super ().__init__ (** kwargs )
1974
1983
if facecolor is None :
1975
1984
facecolor = mpl .rcParams ['figure.facecolor' ]
1976
1985
if edgecolor is None :
@@ -2114,6 +2123,7 @@ def draw(self, renderer):
2114
2123
self .stale = False
2115
2124
2116
2125
2126
+ @docstring .interpd
2117
2127
class Figure (FigureBase ):
2118
2128
"""
2119
2129
The top level container for all the plot elements.
@@ -2154,6 +2164,7 @@ def __init__(self,
2154
2164
subplotpars = None , # rc figure.subplot.*
2155
2165
tight_layout = None , # rc figure.autolayout
2156
2166
constrained_layout = None , # rc figure.constrained_layout.use
2167
+ ** kwargs
2157
2168
):
2158
2169
"""
2159
2170
Parameters
@@ -2195,8 +2206,14 @@ def __init__(self,
2195
2206
:doc:`/tutorials/intermediate/constrainedlayout_guide`
2196
2207
for examples. (Note: does not work with `add_subplot` or
2197
2208
`~.pyplot.subplot2grid`.)
2209
+
2210
+ Other Parameters
2211
+ ----------------
2212
+ **kwargs : `.Figure` properties, optional
2213
+
2214
+ %(Figure:kwdoc)s
2198
2215
"""
2199
- super ().__init__ ()
2216
+ super ().__init__ (** kwargs )
2200
2217
2201
2218
self .callbacks = cbook .CallbackRegistry ()
2202
2219
# Callbacks traditionally associated with the canvas (and exposed with
0 commit comments