.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "_gallery/image_collection/image_grid.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr__gallery_image_collection_image_grid.py: Image Grid ========== Arrange a collection of images in a grid using ``shape`` and ``separation``. .. GENERATED FROM PYTHON SOURCE LINES 7-30 .. image-sg:: /_gallery/image_collection/images/sphx_glr_image_grid_001.webp :alt: image grid :srcset: /_gallery/image_collection/images/sphx_glr_image_grid_001.webp :class: sphx-glr-single-img .. code-block:: Python # test_example = false import numpy as np import fastplotlib as fpl rng = np.random.default_rng(0) # a collection of random 100 x 100 images images = [rng.random((100, 100), dtype=np.float32) for _ in range(6)] figure = fpl.Figure(size=(700, 560)) # lay the images out in a 2 x 3 grid with a gap between rows and columns figure[0, 0].add_image_grid(images, shape=(2, 3), separation=(10, 10), cmap="plasma") figure.show() # NOTE: fpl.loop.run() should not be used for interactive sessions # See the "JupyterLab and IPython" section in the user guide if __name__ == "__main__": print(__doc__) fpl.loop.run() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.215 seconds) .. _sphx_glr_download__gallery_image_collection_image_grid.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: image_grid.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: image_grid.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_