@@ -69,11 +69,8 @@ def do_constrained_layout(fig, h_pad, w_pad,
6969
7070 Parameters
7171 ----------
72- fig : Figure
73- ``Figure`` instance to do the layout in.
74-
75- renderer : Renderer
76- Renderer to use.
72+ fig : `~matplotlib.figure.Figure`
73+ `.Figure` instance to do the layout in.
7774
7875 h_pad, w_pad : float
7976 Padding around the axes elements in figure-normalized units.
@@ -274,7 +271,7 @@ def compress_fixed_aspect(layoutgrids, fig):
274271 extrah = np .zeros (gs .nrows )
275272 elif _gs != gs :
276273 raise ValueError ('Cannot do compressed layout if axes are not'
277- 'all from the same gridspec' )
274+ 'all from the same gridspec' )
278275 orig = ax .get_position (original = True )
279276 actual = ax .get_position (original = False )
280277 dw = orig .width - actual .width
@@ -343,6 +340,19 @@ def make_layout_margins(layoutgrids, fig, renderer, *, w_pad=0, h_pad=0,
343340 decorations on the axis.
344341
345342 Then make room for colorbars.
343+
344+ Parameters
345+ ----------
346+ layoutgrids : dict
347+ fig : `~matplotlib.figure.Figure`
348+ `.Figure` instance to do the layout in.
349+ renderer : `~matplotlib.backend_bases.RendererBase` subclass.
350+ The renderer to use.
351+ w_pad, h_pad : float, default: 0
352+ Width and height padding (in fraction of figure).
353+ hspace, wspace : float, default: 0
354+ Width and height padding as fraction of figure size divided by
355+ number of columns or rows.
346356 """
347357 for sfig in fig .subfigs : # recursively make child panel margins
348358 ss = sfig ._subplotspec
@@ -448,7 +458,7 @@ def make_margin_suptitles(layoutgrids, fig, renderer, *, w_pad=0, h_pad=0):
448458 # get the h_pad and w_pad as distances in the local subfigure coordinates:
449459 padbox = mtransforms .Bbox ([[0 , 0 ], [w_pad , h_pad ]])
450460 padbox = (fig .transFigure -
451- fig .transSubfigure ).transform_bbox (padbox )
461+ fig .transSubfigure ).transform_bbox (padbox )
452462 h_pad_local = padbox .height
453463 w_pad_local = padbox .width
454464
@@ -578,7 +588,12 @@ def match_submerged_margins(layoutgrids, fig):
578588
579589def get_cb_parent_spans (cbax ):
580590 """
581- Figure out which subplotspecs this colorbar belongs to:
591+ Figure out which subplotspecs this colorbar belongs to.
592+
593+ Parameters
594+ ----------
595+ cbax : `~matplotlib.axes.Axes`
596+ Axes for the colorbar.
582597 """
583598 rowstart = np .inf
584599 rowstop = - np .inf
@@ -602,14 +617,14 @@ def get_pos_and_bbox(ax, renderer):
602617
603618 Parameters
604619 ----------
605- ax
606- renderer
620+ ax : `~matplotlib.axes.Axes`
621+ renderer : `~matplotlib.backend_bases.RendererBase` subclass.
607622
608623 Returns
609624 -------
610- pos : Bbox
625+ pos : `~matplotlib.transforms. Bbox`
611626 Position in figure coordinates.
612- bbox : Bbox
627+ bbox : `~matplotlib.transforms. Bbox`
613628 Tight bounding box in figure coordinates.
614629 """
615630 fig = ax .figure
@@ -672,18 +687,14 @@ def reposition_colorbar(layoutgrids, cbax, renderer, *, offset=None):
672687
673688 Parameters
674689 ----------
675- cbax : Axes
676- Axes for the colorbar
677-
678- renderer :
679- w_pad, h_pad : float
680- width and height padding (in fraction of figure)
681- hspace, wspace : float
682- width and height padding as fraction of figure size divided by
683- number of columns or rows
684- margin : array-like
685- offset the colorbar needs to be pushed to in order to
686- account for multiple colorbars
690+ layoutgrids : dict
691+ cbax : `~matplotlib.axes.Axes`
692+ Axes for the colorbar.
693+ renderer : `~matplotlib.backend_bases.RendererBase` subclass.
694+ The renderer to use.
695+ offset : array-like
696+ Offset the colorbar needs to be pushed to in order to
697+ account for multiple colorbars.
687698 """
688699
689700 parents = cbax ._colorbar_info ['parents' ]
@@ -753,7 +764,7 @@ def reposition_colorbar(layoutgrids, cbax, renderer, *, offset=None):
753764
754765def reset_margins (layoutgrids , fig ):
755766 """
756- Reset the margins in the layoutboxes of fig.
767+ Reset the margins in the layoutboxes of * fig* .
757768
758769 Margins are usually set as a minimum, so if the figure gets smaller
759770 the minimum needs to be zero in order for it to grow again.
0 commit comments