.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gyexamples/plot_gallery.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_gyexamples_plot_gallery.py: Plots multiple images in one graph ================================== Or a kind of *gallery*. Let's first get a list of images. .. GENERATED FROM PYTHON SOURCE LINES 8-16 .. code-block:: default import os from pyensae.datasource import download_data zipname = "dog-cat-pixabay.zip" if not os.path.exists("images"): os.mkdir("images") res = download_data(zipname, whereTo="images") print(res) .. rst-class:: sphx-glr-script-out .. code-block:: none ['images/cat-1151519__480.jpg', 'images/cat-1192026__480.jpg', 'images/cat-1508613__480.jpg', 'images/cat-188088__480.jpg', 'images/cat-2083492__480.jpg', 'images/cat-2603300__480.jpg', 'images/cat-2882170__480.jpg', 'images/cat-2917592__480.jpg', 'images/cat-2919036__480.jpg', 'images/cat-2922832__480.jpg', 'images/cat-2942887__480.jpg', 'images/cat-2946028__480.jpg', 'images/cat-2947188__480.jpg', 'images/dachshund-2035700__480.jpg', 'images/dog-1765910__480.jpg', 'images/dog-2365014__480.jpg', 'images/dog-2684073__480.jpg', 'images/dog-2687433__480.jpg', 'images/dog-2687502__480.jpg', 'images/dog-2819614__480.jpg', 'images/dog-2819616__480.jpg', 'images/dog-2863719__480.jpg', 'images/fun-2213606__480.jpg', 'images/happy-1845090__480.jpg', 'images/hot-dog-2361133__480.jpg', 'images/kitty-2948404__480.jpg', 'images/lion-2915164__480.jpg', 'images/schafer-dog-2669660__480.jpg', 'images/shotlanskogo-2934720__480.jpg', 'images/sun-2858214__480.jpg', 'images/wolf-2865653__480.jpg'] .. GENERATED FROM PYTHON SOURCE LINES 17-18 Let's take the first ten images. .. GENERATED FROM PYTHON SOURCE LINES 18-21 .. code-block:: default imgs = res[:10] .. GENERATED FROM PYTHON SOURCE LINES 22-23 And the gallery. .. GENERATED FROM PYTHON SOURCE LINES 23-27 .. code-block:: default from mlinsights.plotting import plot_gallery_images txts = ["img%d" % i for i in range(len(imgs))] plot_gallery_images(imgs, txts) .. image-sg:: /gyexamples/images/sphx_glr_plot_gallery_001.png :alt: plot gallery :srcset: /gyexamples/images/sphx_glr_plot_gallery_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none array([[, , , ], [, , , ], [, , , ]], dtype=object) .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 4.498 seconds) .. _sphx_glr_download_gyexamples_plot_gallery.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_gallery.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_gallery.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_