Shortcuts
This page was generated from doc/gallery/cell-metadata.ipynb. Interactive online version: Binder badge.

Using Cell Metadata to Select a Thumbnail

If the nbsphinx-thumbnail cell tag is not enough, you can use cell metadata to specify more options.

The last cell in this notebook has this metadata:

{
    "nbsphinx-thumbnail": {
        "tooltip": "This tooltip message was defined in cell metadata"
    }
}

If there are multiple outputs in the selected cell, the last one is used. See Choosing from Multiple Outputs for how to select a specific output.

[1]:
import matplotlib.pyplot as plt
import numpy as np
[2]:
plt.rcParams['image.cmap'] = 'coolwarm'
plt.rcParams['image.origin'] = 'lower'

Some example data stolen from https://matplotlib.org/examples/pylab_examples/pcolor_demo.html:

[3]:
x, y = np.meshgrid(np.arange(-3, 3, 0.1), np.arange(-2, 2, 0.1))
z = (1 - x / 2 + x ** 5 + y ** 3) * np.exp(-x ** 2 - y ** 2)
[4]:
zmax = np.max(np.abs(z))
[5]:
fig, ax = plt.subplots(figsize=[5, 3.5])
ax.imshow(z, vmin=-zmax, vmax=zmax)
[5]:
<matplotlib.image.AxesImage at 0x7fee4ff9c590>
../_images/gallery_cell-metadata_7_1.svg
Read the Docs v: pytorch-theme
Versions
latest
0.9.0
0.8.12
0.8.11
0.8.10
0.8.9
0.8.8
0.8.7
0.8.6
0.8.5
0.8.4
0.8.3
0.8.2
0.8.1
0.8.0
0.7.1
0.7.0
0.6.1
0.6.0
0.5.1
0.5.0
0.4.3
0.4.2
0.4.1
0.3.5
0.3.4
0.3.3
0.3.2
0.3.1
0.3.0
0.2.18
0.2.17
0.2.16
0.2.15
0.2.14
0.2.13
0.2.12
0.2.11
0.2.10
0.2.9
0.2.8
0.2.7
0.2.6
0.2.5
0.2.4
0.2.3
0.2.2
0.2.1
0.2.0
uedoc-theme
typlog-theme
traditional-theme
sphinxdoc-theme
sphinx-book-theme
sizzle-theme
scrolls-theme
save-rst
rtd-theme
pyviz-theme
pytorch-theme
python-docs-theme
pyramid-theme
pydata-theme
py3doc-enhanced-theme
pangeo-theme
pandas-theme
nature-theme
material-theme
maisie-theme
jupyter-theme
insipid-theme
holoviz-theme
haiku-theme
guzzle-theme
furo-theme
documatt-theme
dask-theme
cloud-theme
classic-theme
bootstrap-theme
bizstyle-theme
better-theme
basicstrap-theme
astropy-theme
alabaster-theme
agogo-theme
0.1.0
Downloads
pdf
html
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.

Docs

Lorem ipsum dolor sit amet, consectetur

View Docs

Tutorials

Lorem ipsum dolor sit amet, consectetur

View Tutorials

Resources

Lorem ipsum dolor sit amet, consectetur

View Resources