MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / ImageGrid

Class ImageGrid

lib/mpl_toolkits/axes_grid1/axes_grid.py:288–561  ·  view source on GitHub ↗

A grid of Axes for Image display. This class is a specialization of `~.axes_grid1.axes_grid.Grid` for displaying a grid of images. In particular, it forces all axes in a column to share their x-axis and all axes in a row to share their y-axis. It further provides helpers to add

Source from the content-addressed store, hash-verified

286
287
288class ImageGrid(Grid):
289 """
290 A grid of Axes for Image display.
291
292 This class is a specialization of `~.axes_grid1.axes_grid.Grid` for displaying a
293 grid of images. In particular, it forces all axes in a column to share their x-axis
294 and all axes in a row to share their y-axis. It further provides helpers to add
295 colorbars to some or all axes.
296 """
297
298 def __init__(self, fig,
299 rect,
300 nrows_ncols,
301 n_axes=None,
302 direction="row",
303 axes_pad=0.02,
304 *,
305 share_all=False,
306 aspect=True,
307 label_mode="L",
308 cbar_mode=None,
309 cbar_location="right",
310 cbar_pad=None,
311 cbar_size="5%",
312 cbar_set_cax=True,
313 axes_class=None,
314 ):
315 """
316 Parameters
317 ----------
318 fig : `.Figure`
319 The parent figure.
320 rect : (float, float, float, float) or int
321 The axes position, as a ``(left, bottom, width, height)`` tuple or
322 as a three-digit subplot position code (e.g., "121").
323 nrows_ncols : (int, int)
324 Number of rows and columns in the grid.
325 n_axes : int, optional
326 If given, only the first *n_axes* axes in the grid are created.
327 direction : {"row", "column"}, default: "row"
328 Whether axes are created in row-major ("row by row") or
329 column-major order ("column by column"). This also affects the
330 order in which axes are accessed using indexing (``grid[index]``).
331 axes_pad : float or (float, float), default: 0.02in
332 Padding or (horizontal padding, vertical padding) between axes, in
333 inches.
334 share_all : bool, default: False
335 Whether all axes share their x- and y-axis. Note that in any case,
336 all axes in a column share their x-axis and all axes in a row share
337 their y-axis.
338 aspect : bool, default: True
339 Whether the axes aspect ratio follows the aspect ratio of the data
340 limits.
341 label_mode : {"L", "1", "all"}, default: "L"
342 Determines which axes will get tick labels:
343
344 - "L": All axes on the left column get vertical tick labels;
345 all axes on the bottom row get horizontal tick labels.

Calls

no outgoing calls

Used in the wild real call sites across dependent graphs

searching dependent graphs…