{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "\n# Specific images\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "import matplotlib.pyplot as plt\nimport matplotlib\n\nimport skimage as ski\n\nmatplotlib.rcParams[\"font.size\"] = 18"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Stereo images\n\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "fig, axes = plt.subplots(1, 2, figsize=(8, 4))\nax = axes.ravel()\n\ncycle_images = ski.data.stereo_motorcycle()\nax[0].imshow(cycle_images[0])\nax[1].imshow(cycle_images[1])\n\nfig.tight_layout()\nplt.show()"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## PIV images\n\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "fig, axes = plt.subplots(ncols=2, figsize=(8, 4))\nax = axes.ravel()\n\nvortex_images = ski.data.vortex()\nax[0].imshow(vortex_images[0])\nax[1].imshow(vortex_images[1])\n\nfig.tight_layout()\nplt.show()"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "## Faces and non-faces dataset\n\nA sample of 20 over 200 images is displayed.\n\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "fig, axes = plt.subplots(4, 5, figsize=(20, 20))\nax = axes.ravel()\nlfw_images = ski.data.lfw_subset()\nfor i in range(20):\n    ax[i].imshow(lfw_images[90 + i], cmap=plt.cm.gray)\n    ax[i].axis(\"off\")\nfig.tight_layout()\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": [
        "from matplotlib.offsetbox import AnchoredText\n\n# Create a gridspec with two images in the first and 4 in the second row\nfig, axd = plt.subplot_mosaic(\n    [[\"stereo\", \"stereo\", \"piv\", \"piv\"], [\"lfw0\", \"lfw1\", \"lfw2\", \"lfw3\"]],\n)\naxd[\"stereo\"].imshow(cycle_images[0])\naxd[\"stereo\"].add_artist(\n    AnchoredText(\n        \"Stereo\",\n        prop=dict(size=20),\n        frameon=True,\n        borderpad=0,\n        loc=\"upper left\",\n    )\n)\naxd[\"piv\"].imshow(vortex_images[0])\naxd[\"piv\"].add_artist(\n    AnchoredText(\n        \"PIV\",\n        prop=dict(size=20),\n        frameon=True,\n        borderpad=0,\n        loc=\"upper left\",\n    )\n)\naxd[\"lfw0\"].imshow(lfw_images[91], cmap=\"gray\")\naxd[\"lfw1\"].imshow(lfw_images[92], cmap=\"gray\")\naxd[\"lfw2\"].imshow(lfw_images[93], cmap=\"gray\")\naxd[\"lfw3\"].imshow(lfw_images[94], cmap=\"gray\")\n\nfor ax in axd.values():\n    ax.axis(\"off\")\nfig.tight_layout()\nplt.show()"
      ]
    }
  ],
  "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
}