{
  "cells": [
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "%matplotlib inline"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "\n# Link to other packages\n\n\nUse :mod:`sphinx_gallery` to link to other packages, like\n:mod:`numpy`, :mod:`matplotlib.colors`, and :mod:`matplotlib.pyplot`.\n\nFYI this gallery uses :obj:`sphinx_gallery.sorting.FileNameSortKey`.\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "from warnings import warn\n\nimport numpy as np\nfrom matplotlib.colors import is_color_like\nfrom matplotlib.figure import Figure\nfrom itertools import compress  # noqa\nimport matplotlib\nimport matplotlib.pyplot as plt\nimport sphinx_gallery.backreferences\n\nfrom local_module import N  # N = 1000\n\nt = np.arange(N) / float(N)\nwin = np.hanning(N)\nprint(is_color_like('r'))\nfig, ax = plt.subplots()\nax.plot(t, win, color='r')\nax.text(0, 1, 'png', size=40, va='top')\nfig.tight_layout()\norig_dpi = 80. if matplotlib.__version__[0] < '2' else 100.\nassert plt.rcParams['figure.dpi'] == orig_dpi\nplt.rcParams['figure.dpi'] = 70.\nassert plt.rcParams['figure.dpi'] == 70.\nlisty = [0, 1]\ncompress('abc', [0, 0, 1])\nwarn('This warning should show up in the output', RuntimeWarning)\nx = Figure()  # plt.Figure should be decorated (class), x shouldn't (inst)\n# nested resolution resolves to numpy.random.mtrand.RandomState:\nrng = np.random.RandomState(0)\n# test Issue 583\nsphinx_gallery.backreferences.identify_names([('text', 'Text block', 1)])\n# 583: methods don't link properly\ndc = sphinx_gallery.backreferences.DummyClass()\ndc.run()\nprint(dc.prop)"
      ]
    }
  ],
  "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
}