lets_plot.bistro.im.image_matrix

lets_plot.bistro.im.image_matrix(image_data_array, *, norm: Optional[bool] = None, scale=1) lets_plot.plot.plot.GGBunch

Display images in a grid. The grid dimensions are determined by shape of the input 2D ndarray.

Elements of the input 2D array are images specified by ndarrays with shape (n, m) or (n, m, 3) or (n, m, 4).

Parameters
  • image_data_array (ndarray) – 2D numpy.ndarray containing images. Specifies dimensions of output grid.

  • norm (bool, default=True) – False value disables default scaling of a luminance (grayscale) images to the (0, 255) range.

  • scale (float, default=1.0) – Specifies magnification factor.

Returns

Plot bunch object.

Return type

GGBunch

Examples

1import numpy as np
2from lets_plot import *
3from lets_plot.bistro.im import *
4LetsPlot.setup_html()
5np.random.seed(42)
6image = np.random.randint(256, size=(64, 64, 3))
7matrix = np.empty((2, 3), dtype=object)
8matrix.fill(image)
9image_matrix(matrix)