@@ -82,12 +82,13 @@ def cla(self):
8282
8383class Grid :
8484 """
85- A class that creates a grid of Axes. In matplotlib, the axes
86- location (and size) is specified in the normalized figure
87- coordinates. This may not be ideal for images that needs to be
88- displayed with a given aspect ratio. For example, displaying
89- images of a same size with some fixed padding between them cannot
90- be easily done in matplotlib. AxesGrid is used in such case.
85+ A grid of Axes.
86+
87+ In Matplotlib, the axes location (and size) is specified in normalized
88+ figure coordinates. This may not be ideal for images that needs to be
89+ displayed with a given aspect ratio; for example, it is difficult to
90+ display multiple images of a same size with some fixed padding between
91+ them. AxesGrid can be used in such case.
9192 """
9293
9394 _defaultAxesClass = Axes
@@ -115,14 +116,25 @@ def __init__(self, fig,
115116 rect : (float, float, float, float) or int
116117 The axes position, as a ``(left, bottom, width, height)`` tuple or
117118 as a three-digit subplot position code (e.g., "121").
119+ nrows_ncols : (int, int)
120+ Number of rows and columns in the grid.
121+ ngrids : int or None, default: None
122+ If not None, only the first *ngrids* axes in the grid are created.
118123 direction : {"row", "column"}, default: "row"
124+ Whether axes are created in row-major ("row by row") or
125+ column-major order ("column by column").
119126 axes_pad : float or (float, float), default: 0.02
120127 Padding or (horizontal padding, vertical padding) between axes, in
121128 inches.
122129 add_all : bool, default: True
130+ Whether to add the axes to the figure using `.Figure.add_axes`.
123131 share_all : bool, default: False
132+ Whether all axes share their x- and y-axis. Overrides *share_x*
133+ and *share_y*.
124134 share_x : bool, default: True
135+ Whether all axes of a column share their x-axis.
125136 share_y : bool, default: True
137+ Whether all axes of a row share their y-axis.
126138 label_mode : {"L", "1", "all"}, default: "L"
127139 Determines which axes will get tick labels:
128140
@@ -133,6 +145,8 @@ def __init__(self, fig,
133145
134146 axes_class : subclass of `matplotlib.axes.Axes`, default: None
135147 aspect : bool, default: False
148+ Whether the axes aspect ratio follows the aspect ratio of the data
149+ limits.
136150 """
137151 self ._nrows , self ._ncols = nrows_ncols
138152
@@ -332,14 +346,7 @@ def get_vsize_hsize(self):
332346
333347
334348class ImageGrid (Grid ):
335- """
336- A class that creates a grid of Axes. In matplotlib, the axes
337- location (and size) is specified in the normalized figure
338- coordinates. This may not be ideal for images that needs to be
339- displayed with a given aspect ratio. For example, displaying
340- images of a same size with some fixed padding between them cannot
341- be easily done in matplotlib. ImageGrid is used in such case.
342- """
349+ # docstring inherited
343350
344351 _defaultCbarAxesClass = CbarAxes
345352
@@ -368,13 +375,24 @@ def __init__(self, fig,
368375 rect : (float, float, float, float) or int
369376 The axes position, as a ``(left, bottom, width, height)`` tuple or
370377 as a three-digit subplot position code (e.g., "121").
378+ nrows_ncols : (int, int)
379+ Number of rows and columns in the grid.
380+ ngrids : int or None, default: None
381+ If not None, only the first *ngrids* axes in the grid are created.
371382 direction : {"row", "column"}, default: "row"
372- axes_pad : float or (float, float), default: 0.02
383+ Whether axes are created in row-major ("row by row") or
384+ column-major order ("column by column"). This also affects the
385+ order in which axes are accessed using indexing (``grid[index]``).
386+ axes_pad : float or (float, float), default: 0.02in
373387 Padding or (horizontal padding, vertical padding) between axes, in
374388 inches.
375389 add_all : bool, default: True
390+ Whether to add the axes to the figure using `.Figure.add_axes`.
376391 share_all : bool, default: False
392+ Whether all axes share their x- and y-axis.
377393 aspect : bool, default: True
394+ Whether the axes aspect ratio follows the aspect ratio of the data
395+ limits.
378396 label_mode : {"L", "1", "all"}, default: "L"
379397 Determines which axes will get tick labels:
380398
@@ -383,10 +401,16 @@ def __init__(self, fig,
383401 - "1": Only the bottom left axes is labelled.
384402 - "all": all axes are labelled.
385403
386- cbar_mode : {"each", "single", "edge", None }, default: None
404+ cbar_mode : {"each", "single", "edge", None}, default: None
405+ Whether to create a colorbar for "each" axes, a "single" colorbar
406+ for the entire grid, colorbars only for axes on the "edge"
407+ determined by *cbar_location*, or no colorbars. The colorbars are
408+ stored in the :attr:`cbar_axes` attribute.
387409 cbar_location : {"left", "right", "bottom", "top"}, default: "right"
388410 cbar_pad : float, default: None
411+ Padding between the image axes and the colorbar axes.
389412 cbar_size : size specification (see `.Size.from_any`), default: "5%"
413+ Colorbar size.
390414 cbar_set_cax : bool, default: True
391415 If True, each axes in the grid has a *cax* attribute that is bound
392416 to associated *cbar_axes*.
0 commit comments