{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "\n# General-purpose images\n\nThe title of each image indicates the name of the function.\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "import matplotlib.pyplot as plt\nimport matplotlib\nimport numpy as np\nimport skimage as ski\n\nmatplotlib.rcParams['font.size'] = 18\n\nimages = (\n    'astronaut',\n    'binary_blobs',\n    'brick',\n    'colorwheel',\n    'camera',\n    'cat',\n    'checkerboard',\n    'clock',\n    'coffee',\n    'coins',\n    'eagle',\n    'grass',\n    'gravel',\n    'horse',\n    'logo',\n    'page',\n    'text',\n    'rocket',\n)\n\n\nfor name in images:\n    caller = getattr(ski.data, name)\n    image = caller()\n    plt.figure()\n    plt.title(name)\n    if image.ndim == 2:\n        plt.imshow(image, cmap=plt.cm.gray)\n    else:\n        plt.imshow(image)\n\nplt.show()"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "Thumbnail image for the gallery\n\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "fig, axs = plt.subplots(nrows=3, ncols=3)\nfor ax in axs.flat:\n    ax.axis(\"off\")\naxs[0, 0].imshow(ski.data.astronaut())\naxs[0, 1].imshow(ski.data.binary_blobs(), cmap=plt.cm.gray)\naxs[0, 2].imshow(ski.data.brick(), cmap=plt.cm.gray)\naxs[1, 0].imshow(ski.data.colorwheel())\naxs[1, 1].imshow(ski.data.camera(), cmap=plt.cm.gray)\naxs[1, 2].imshow(ski.data.cat())\naxs[2, 0].imshow(ski.data.checkerboard(), cmap=plt.cm.gray)\naxs[2, 1].imshow(ski.data.clock(), cmap=plt.cm.gray)\nfurther_img = np.full((300, 300), 255)\nfor xpos in [100, 150, 200]:\n    further_img[150 - 10 : 150 + 10, xpos - 10 : xpos + 10] = 0\naxs[2, 2].imshow(further_img, cmap=plt.cm.gray)\nplt.subplots_adjust(wspace=0.1, hspace=0.1)"
      ]
    }
  ],
  "metadata": {
    "kernelspec": {
      "display_name": "Python 3",
      "language": "python",
      "name": "python3"
    },
    "language_info": {
      "codemirror_mode": {
        "name": "ipython",
        "version": 3
      },
      "file_extension": ".py",
      "mimetype": "text/x-python",
      "name": "python",
      "nbconvert_exporter": "python",
      "pygments_lexer": "ipython3",
      "version": "3.12.12"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}