This page was generated from doc/gallery/multiple-outputs.ipynb. Interactive online version: Binder badge.

Choosing from Multiple Outputs§

By default, the last output of the selected cell is used as a thumbnail. If that’s what you want, you can simply use the nbsphinx-thumbnail cell tag.

If you want to specify one of multiple outputs, you can add a (zero-based) "output-index" to your "nbsphinx-thumbnail" cell metadata.

The following cell has this metadata, selecting the third output to be used as thumbnail in the gallery.

{
    "nbsphinx-thumbnail": {
        "output-index": 2
    }
}
[1]:
from IPython.display import Image

display(Image(url='https://jupyter.org/assets/nav_logo.svg'))
print('Hello!')
display(Image(filename='../images/notebook_icon.png'))
display(Image(url='https://www.python.org/static/img/python-logo-large.png', embed=True))
Hello!
../_images/gallery_multiple-outputs_2_2.png
../_images/gallery_multiple-outputs_2_3.png