.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/data/plot_scientific.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_scientific.py: ================= Scientific images ================= The title of each image indicates the name of the function. .. GENERATED FROM PYTHON SOURCE LINES 9-45 .. code-block:: Python import matplotlib.pyplot as plt import matplotlib import numpy as np from skimage import data matplotlib.rcParams['font.size'] = 18 images = ( 'hubble_deep_field', 'immunohistochemistry', 'lily', 'microaneurysms', 'moon', 'retina', 'shepp_logan_phantom', 'skin', 'cell', 'human_mitosis', ) 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_scientific_001.png :alt: hubble_deep_field :srcset: /auto_examples/data/images/sphx_glr_plot_scientific_001.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/data/images/sphx_glr_plot_scientific_002.png :alt: immunohistochemistry :srcset: /auto_examples/data/images/sphx_glr_plot_scientific_002.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/data/images/sphx_glr_plot_scientific_003.png :alt: lily :srcset: /auto_examples/data/images/sphx_glr_plot_scientific_003.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/data/images/sphx_glr_plot_scientific_004.png :alt: microaneurysms :srcset: /auto_examples/data/images/sphx_glr_plot_scientific_004.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/data/images/sphx_glr_plot_scientific_005.png :alt: moon :srcset: /auto_examples/data/images/sphx_glr_plot_scientific_005.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/data/images/sphx_glr_plot_scientific_006.png :alt: retina :srcset: /auto_examples/data/images/sphx_glr_plot_scientific_006.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/data/images/sphx_glr_plot_scientific_007.png :alt: shepp_logan_phantom :srcset: /auto_examples/data/images/sphx_glr_plot_scientific_007.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/data/images/sphx_glr_plot_scientific_008.png :alt: skin :srcset: /auto_examples/data/images/sphx_glr_plot_scientific_008.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/data/images/sphx_glr_plot_scientific_009.png :alt: cell :srcset: /auto_examples/data/images/sphx_glr_plot_scientific_009.png :class: sphx-glr-multi-img * .. image-sg:: /auto_examples/data/images/sphx_glr_plot_scientific_010.png :alt: human_mitosis :srcset: /auto_examples/data/images/sphx_glr_plot_scientific_010.png :class: sphx-glr-multi-img .. rst-class:: sphx-glr-script-out .. code-block:: none Clipping input data to the valid range for imshow with RGB data ([0..1] for floats or [0..255] for integers). .. GENERATED FROM PYTHON SOURCE LINES 46-47 Thumbnail image for the gallery .. GENERATED FROM PYTHON SOURCE LINES 47-65 .. code-block:: Python fig, axs = plt.subplots(nrows=3, ncols=3) for ax in axs.flat: ax.axis("off") axs[0, 0].imshow(data.hubble_deep_field()) axs[0, 1].imshow(data.immunohistochemistry()) axs[0, 2].imshow(data.lily()) axs[1, 0].imshow(data.microaneurysms()) axs[1, 1].imshow(data.moon(), cmap=plt.cm.gray) axs[1, 2].imshow(data.retina()) axs[2, 0].imshow(data.shepp_logan_phantom(), cmap=plt.cm.gray) axs[2, 1].imshow(data.skin()) 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.3, hspace=0.1) .. image-sg:: /auto_examples/data/images/sphx_glr_plot_scientific_011.png :alt: plot scientific :srcset: /auto_examples/data/images/sphx_glr_plot_scientific_011.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none Clipping input data to the valid range for imshow with RGB data ([0..1] for floats or [0..255] for integers). .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 3.821 seconds) .. _sphx_glr_download_auto_examples_data_plot_scientific.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_scientific.ipynb :alt: Launch binder :width: 150 px .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_scientific.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_scientific.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_