.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/data/plot_general.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 or to run this example in your browser via Binder .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_examples_data_plot_general.py: ====================== General-purpose images ====================== The title of each image indicates the name of the function. .. GENERATED FROM PYTHON SOURCE LINES 9-53 .. code-block:: Python import matplotlib.pyplot as plt import matplotlib import numpy as np from skimage import data matplotlib.rcParams['font.size'] = 18 images = ( 'astronaut', 'binary_blobs', 'brick', 'colorwheel', 'camera', 'cat', 'checkerboard', 'clock', 'coffee', 'coins', 'eagle', 'grass', 'gravel', 'horse', 'logo', 'page', 'text', 'rocket', ) for name in images: caller = getattr(data, name) image = caller() plt.figure() plt.title(name) if image.ndim == 2: plt.imshow(image, cmap=plt.cm.gray) else: plt.imshow(image) plt.show() .. rst-class:: sphx-glr-horizontal * .. image-sg:: /auto_examples/data/images/sphx_glr_plot_general_001.png :alt: astronaut :srcset: /auto_examples/data/images/sphx_glr_plot_general_001.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/data/images/sphx_glr_plot_general_002.png :alt: binary_blobs :srcset: /auto_examples/data/images/sphx_glr_plot_general_002.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/data/images/sphx_glr_plot_general_003.png :alt: brick :srcset: /auto_examples/data/images/sphx_glr_plot_general_003.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/data/images/sphx_glr_plot_general_004.png :alt: colorwheel :srcset: /auto_examples/data/images/sphx_glr_plot_general_004.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/data/images/sphx_glr_plot_general_005.png :alt: camera :srcset: /auto_examples/data/images/sphx_glr_plot_general_005.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/data/images/sphx_glr_plot_general_006.png :alt: cat :srcset: /auto_examples/data/images/sphx_glr_plot_general_006.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/data/images/sphx_glr_plot_general_007.png :alt: checkerboard :srcset: /auto_examples/data/images/sphx_glr_plot_general_007.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/data/images/sphx_glr_plot_general_008.png :alt: clock :srcset: /auto_examples/data/images/sphx_glr_plot_general_008.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/data/images/sphx_glr_plot_general_009.png :alt: coffee :srcset: /auto_examples/data/images/sphx_glr_plot_general_009.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/data/images/sphx_glr_plot_general_010.png :alt: coins :srcset: /auto_examples/data/images/sphx_glr_plot_general_010.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/data/images/sphx_glr_plot_general_011.png :alt: eagle :srcset: /auto_examples/data/images/sphx_glr_plot_general_011.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/data/images/sphx_glr_plot_general_012.png :alt: grass :srcset: /auto_examples/data/images/sphx_glr_plot_general_012.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/data/images/sphx_glr_plot_general_013.png :alt: gravel :srcset: /auto_examples/data/images/sphx_glr_plot_general_013.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/data/images/sphx_glr_plot_general_014.png :alt: horse :srcset: /auto_examples/data/images/sphx_glr_plot_general_014.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/data/images/sphx_glr_plot_general_015.png :alt: logo :srcset: /auto_examples/data/images/sphx_glr_plot_general_015.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/data/images/sphx_glr_plot_general_016.png :alt: page :srcset: /auto_examples/data/images/sphx_glr_plot_general_016.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/data/images/sphx_glr_plot_general_017.png :alt: text :srcset: /auto_examples/data/images/sphx_glr_plot_general_017.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/data/images/sphx_glr_plot_general_018.png :alt: rocket :srcset: /auto_examples/data/images/sphx_glr_plot_general_018.png :class: sphx-glr-multi-img .. GENERATED FROM PYTHON SOURCE LINES 54-55 Thumbnail image for the gallery .. GENERATED FROM PYTHON SOURCE LINES 55-72 .. code-block:: Python fig, axs = plt.subplots(nrows=3, ncols=3) for ax in axs.flat: ax.axis("off") axs[0, 0].imshow(data.astronaut()) axs[0, 1].imshow(data.binary_blobs(), cmap=plt.cm.gray) axs[0, 2].imshow(data.brick(), cmap=plt.cm.gray) axs[1, 0].imshow(data.colorwheel()) axs[1, 1].imshow(data.camera(), cmap=plt.cm.gray) axs[1, 2].imshow(data.cat()) axs[2, 0].imshow(data.checkerboard(), cmap=plt.cm.gray) axs[2, 1].imshow(data.clock(), cmap=plt.cm.gray) further_img = np.full((300, 300), 255) for xpos in [100, 150, 200]: further_img[150 - 10 : 150 + 10, xpos - 10 : xpos + 10] = 0 axs[2, 2].imshow(further_img, cmap=plt.cm.gray) plt.subplots_adjust(wspace=0.1, hspace=0.1) .. image-sg:: /auto_examples/data/images/sphx_glr_plot_general_019.png :alt: plot general :srcset: /auto_examples/data/images/sphx_glr_plot_general_019.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 5.755 seconds) .. _sphx_glr_download_auto_examples_data_plot_general.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: binder-badge .. image:: images/binder_badge_logo.svg :target: https://mybinder.org/v2/gh/scikit-image/scikit-image/v0.23.2?filepath=notebooks/auto_examples/data/plot_general.ipynb :alt: Launch binder :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_general.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_general.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_