@@ -259,15 +259,17 @@ class Figure(Artist):
259
259
the callback will be called with ``func(fig)`` where fig is the
260
260
:class:`Figure` instance.
261
261
262
- *patch*
263
- The figure patch is drawn by a
264
- :class:`matplotlib.patches.Rectangle` instance
265
-
266
- *suppressComposite*
267
- For multiple figure images, the figure will make composite
268
- images depending on the renderer option_image_nocomposite
269
- function. If suppressComposite is True|False, this will
270
- override the renderer.
262
+ Attributes
263
+ ----------
264
+ patch
265
+ The figure patch is drawn by a
266
+ :class:`matplotlib.patches.Rectangle` instance
267
+
268
+ suppressComposite
269
+ For multiple figure images, the figure will make composite images
270
+ depending on the renderer option_image_nocomposite function.
271
+ If *suppressComposite* is ``True`` or ``False``, this will override
272
+ the renderer.
271
273
"""
272
274
273
275
def __str__ (self ):
@@ -284,33 +286,35 @@ def __init__(self,
284
286
tight_layout = None , # default to rc figure.autolayout
285
287
):
286
288
"""
287
- *figsize*
288
- w,h tuple in inches
289
+ Parameters
290
+ ----------
291
+ figsize : 2-tuple of floats
292
+ ``(width, height)`` tuple in inches
289
293
290
- * dpi*
294
+ dpi : float
291
295
Dots per inch
292
296
293
- * facecolor*
297
+ facecolor
294
298
The figure patch facecolor; defaults to rc ``figure.facecolor``
295
299
296
- * edgecolor*
300
+ edgecolor
297
301
The figure patch edge color; defaults to rc ``figure.edgecolor``
298
302
299
- * linewidth*
303
+ linewidth : float
300
304
The figure patch edge linewidth; the default linewidth of the frame
301
305
302
- * frameon*
303
- If * False* , suppress drawing the figure frame
306
+ frameon : bool
307
+ If `` False`` , suppress drawing the figure frame
304
308
305
- * subplotpars*
306
- A :class:`SubplotParams` instance , defaults to rc
309
+ subplotpars : :class:`SubplotParams`
310
+ Subplot parameters , defaults to rc
307
311
308
- * tight_layout*
309
- If * False* use *subplotpars*; if * True* adjust subplot
312
+ tight_layout : bool
313
+ If `` False`` use *subplotpars*; if `` True`` adjust subplot
310
314
parameters using :meth:`tight_layout` with default padding.
311
- When providing a dict containing the keys `pad`, `w_pad`, `h_pad`
312
- and `rect`, the default :meth:`tight_layout` paddings will be
313
- overridden.
315
+ When providing a dict containing the keys
316
+ ``pad``, ``w_pad``, ``h_pad``, and ``rect``, the default
317
+ :meth:`tight_layout` paddings will be overridden.
314
318
Defaults to rc ``figure.autolayout``.
315
319
"""
316
320
Artist .__init__ (self )
@@ -382,7 +386,7 @@ def _repr_html_(self):
382
386
# We can't use "isinstance" here, because then we'd end up importing
383
387
# webagg unconditiionally.
384
388
if (self .canvas is not None and
385
- 'WebAgg' in self .canvas .__class__ .__name__ ):
389
+ 'WebAgg' in self .canvas .__class__ .__name__ ):
386
390
from matplotlib .backends import backend_webagg
387
391
return backend_webagg .ipython_inline_display (self )
388
392
@@ -395,8 +399,15 @@ def show(self, warn=True):
395
399
:class:`~matplotlib.backend_bases.FigureManagerBase`, and
396
400
will raise an AttributeError.
397
401
398
- For non-GUI backends, this does nothing, in which case
399
- a warning will be issued if *warn* is True (default).
402
+ Parameters
403
+ ----------
404
+ warm : bool
405
+ If ``True``, issue warning when called on a non-GUI backend
406
+
407
+ Notes
408
+ -----
409
+ For non-GUI backends, this does nothing, in which case a warning will
410
+ be issued if *warn* is ``True`` (default).
400
411
"""
401
412
try :
402
413
manager = getattr (self .canvas , 'manager' )
@@ -428,7 +439,12 @@ def _get_dpi(self):
428
439
429
440
def _set_dpi (self , dpi , forward = True ):
430
441
"""
431
- The forward kwarg is passed on to set_size_inches
442
+ Parameters
443
+ ----------
444
+ dpi : float
445
+
446
+ forward : bool
447
+ Passed on to `~.Figure.set_size_inches`
432
448
"""
433
449
self ._dpi = dpi
434
450
self .dpi_scale_trans .clear ().scale (dpi , dpi )
@@ -440,7 +456,7 @@ def _set_dpi(self, dpi, forward=True):
440
456
441
457
def get_tight_layout (self ):
442
458
"""
443
- Return the Boolean flag, True to use :meth:`tight_layout` when drawing.
459
+ Return whether the figure uses :meth:`tight_layout` when drawing.
444
460
"""
445
461
return self ._tight
446
462
@@ -531,7 +547,9 @@ def contains(self, mouseevent):
531
547
return inside , {}
532
548
533
549
def get_window_extent (self , * args , ** kwargs ):
534
- 'get the figure bounding box in display space; kwargs are void'
550
+ ''''
551
+ Return figure bounding box in display space; arguments are ignored.
552
+ '''
535
553
return self .bbox
536
554
537
555
def suptitle (self , t , ** kwargs ):
0 commit comments