{
  "cells": [
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "%matplotlib inline"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "\n# Animation support\n\nShow an animation, which should end up nicely embedded below.\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "import numpy as np\nimport matplotlib.pyplot as plt\nimport matplotlib.animation as animation\n\n# Adapted from\n# https://matplotlib.org/gallery/animation/basic_example.html\n\n\ndef _update_line(num):\n    line.set_data(data[..., :num])\n    return line,\n\n\nfig_0, ax_0 = plt.subplots(figsize=(5, 1))\n\n# sphinx_gallery_thumbnail_number = 2\nfig_1, ax_1 = plt.subplots(figsize=(5, 5))\ndata = np.random.RandomState(0).rand(2, 25)\nline, = ax_1.plot([], [], 'r-')\nax_1.set(xlim=(0, 1), ylim=(0, 1))\nani = animation.FuncAnimation(fig_1, _update_line, 25, interval=100, blit=True)\n\nfig_2, ax_2 = plt.subplots(figsize=(5, 5))"
      ]
    }
  ],
  "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.7.5"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}