Skip to content

Choose the best thumbnail image for tutorials #819

@seisman

Description

@seisman

Description of the problem

A tutorial script sometimes generates multiple images. The sphinx-gallery extension always chooses the first image as the thumbnail image. However, the first image may not be the best one.

Just take the colorbar documentation as an example.

image

Looking at the 5 examples. The last 3 examples don't show any colorbars, thus making the thumbnail images useless.

For these tutorials, it would to better if we can choose the best image as the thumbnail image. This can be done by adding a comment line # sphinx_gallery_thumbnail_number = <fig_number> in the docstring of the tutorial script. See the sphinx-gallery documentation for details.

I don't test it, but it should work. I think what we need to do:

  1. Go through all tutorial scripts and add the comment line if necessary
  2. Document it in the CONTRIBUTING.md file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementImproving an existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions