From 3e6f58e4f613b649f89c99ee42a4d33f0adb5a1c Mon Sep 17 00:00:00 2001 From: ayeshakhalid192007-dev Date: Sat, 4 Apr 2026 19:14:19 +0500 Subject: [PATCH] doc: add thumbnails for skipped gallery examples Several gallery examples that use the `_sgskip` suffix (excluded from documentation build execution) were missing thumbnails, causing placeholder grey boxes to appear in the gallery index page. Add sphinx_gallery_thumbnail_path directives to 9 examples, along with 6 new SVG thumbnail images in doc/_static/ that visually represent what each example does: - animation/frame_grabbing_sgskip: film-strip animation thumbnail - event_handling/ginput_manual_clabel_sgskip: contour plot with cursor - event_handling/pong_sgskip: pong game court thumbnail - misc/hyperlinks_sgskip: scatter plot with link indicators - misc/image_thumbnail_sgskip: reuse existing stinkbug.png - misc/multiprocess_sgskip: real-time producer/plotter diagram - misc/print_stdout_sgskip: terminal + line plot thumbnail - mplot3d/wire3d_animation_sgskip: reuse existing demo_mplot3d.png - widgets/lasso_selector_demo_sgskip: scatter with lasso selection Closes #17479 --- .../frame_grabbing_sgskip_thumbnail.svg | 34 +++++++++++++++++++ .../ginput_manual_clabel_sgskip_thumbnail.svg | 20 +++++++++++ doc/_static/hyperlinks_sgskip_thumbnail.svg | 17 ++++++++++ .../lasso_selector_sgskip_thumbnail.svg | 21 ++++++++++++ doc/_static/multiprocess_sgskip_thumbnail.svg | 22 ++++++++++++ doc/_static/pong_sgskip_thumbnail.svg | 16 +++++++++ doc/_static/print_stdout_sgskip_thumbnail.svg | 19 +++++++++++ .../animation/frame_grabbing_sgskip.py | 1 + .../ginput_manual_clabel_sgskip.py | 1 + .../examples/event_handling/pong_sgskip.py | 1 + galleries/examples/misc/hyperlinks_sgskip.py | 1 + .../examples/misc/image_thumbnail_sgskip.py | 1 + .../examples/misc/multiprocess_sgskip.py | 1 + .../examples/misc/print_stdout_sgskip.py | 1 + .../mplot3d/wire3d_animation_sgskip.py | 1 + .../widgets/lasso_selector_demo_sgskip.py | 1 + 16 files changed, 158 insertions(+) create mode 100644 doc/_static/frame_grabbing_sgskip_thumbnail.svg create mode 100644 doc/_static/ginput_manual_clabel_sgskip_thumbnail.svg create mode 100644 doc/_static/hyperlinks_sgskip_thumbnail.svg create mode 100644 doc/_static/lasso_selector_sgskip_thumbnail.svg create mode 100644 doc/_static/multiprocess_sgskip_thumbnail.svg create mode 100644 doc/_static/pong_sgskip_thumbnail.svg create mode 100644 doc/_static/print_stdout_sgskip_thumbnail.svg diff --git a/doc/_static/frame_grabbing_sgskip_thumbnail.svg b/doc/_static/frame_grabbing_sgskip_thumbnail.svg new file mode 100644 index 000000000000..6502ccacf066 --- /dev/null +++ b/doc/_static/frame_grabbing_sgskip_thumbnail.svg @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/_static/ginput_manual_clabel_sgskip_thumbnail.svg b/doc/_static/ginput_manual_clabel_sgskip_thumbnail.svg new file mode 100644 index 000000000000..ff24788362cf --- /dev/null +++ b/doc/_static/ginput_manual_clabel_sgskip_thumbnail.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + -1.0 + + -0.5 + + 0.5 + + + diff --git a/doc/_static/hyperlinks_sgskip_thumbnail.svg b/doc/_static/hyperlinks_sgskip_thumbnail.svg new file mode 100644 index 000000000000..c37c16d4b60f --- /dev/null +++ b/doc/_static/hyperlinks_sgskip_thumbnail.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + 🔗 + + SVG Hyperlinks + diff --git a/doc/_static/lasso_selector_sgskip_thumbnail.svg b/doc/_static/lasso_selector_sgskip_thumbnail.svg new file mode 100644 index 000000000000..c55cda59ef3e --- /dev/null +++ b/doc/_static/lasso_selector_sgskip_thumbnail.svg @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/doc/_static/multiprocess_sgskip_thumbnail.svg b/doc/_static/multiprocess_sgskip_thumbnail.svg new file mode 100644 index 000000000000..fe6b327e86aa --- /dev/null +++ b/doc/_static/multiprocess_sgskip_thumbnail.svg @@ -0,0 +1,22 @@ + + + + + + + + + Process A (data) + + + Process B (plot) + + + + + Producer + + Plotter + diff --git a/doc/_static/pong_sgskip_thumbnail.svg b/doc/_static/pong_sgskip_thumbnail.svg new file mode 100644 index 000000000000..1847f6a01d53 --- /dev/null +++ b/doc/_static/pong_sgskip_thumbnail.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + 3 + 5 + diff --git a/doc/_static/print_stdout_sgskip_thumbnail.svg b/doc/_static/print_stdout_sgskip_thumbnail.svg new file mode 100644 index 000000000000..f6a41cdbabe6 --- /dev/null +++ b/doc/_static/print_stdout_sgskip_thumbnail.svg @@ -0,0 +1,19 @@ + + + + + + + + + + $ python print_stdout.py > out.png + PNG + ██████ + IHDR + ████ + + + + plot saved to stdout + diff --git a/galleries/examples/animation/frame_grabbing_sgskip.py b/galleries/examples/animation/frame_grabbing_sgskip.py index dcc2ca01afd9..8b095668ae6d 100644 --- a/galleries/examples/animation/frame_grabbing_sgskip.py +++ b/galleries/examples/animation/frame_grabbing_sgskip.py @@ -7,6 +7,7 @@ file. This avoids any event loop integration, and thus works even with the Agg backend. This is not recommended for use in an interactive setting. """ +# sphinx_gallery_thumbnail_path = '_static/frame_grabbing_sgskip_thumbnail.svg' import numpy as np diff --git a/galleries/examples/event_handling/ginput_manual_clabel_sgskip.py b/galleries/examples/event_handling/ginput_manual_clabel_sgskip.py index a4f4f670f620..e0e4053e7af3 100644 --- a/galleries/examples/event_handling/ginput_manual_clabel_sgskip.py +++ b/galleries/examples/event_handling/ginput_manual_clabel_sgskip.py @@ -14,6 +14,7 @@ You can copy and paste individual parts, or download the entire example using the link at the bottom of the page. """ +# sphinx_gallery_thumbnail_path = '_static/ginput_manual_clabel_sgskip_thumbnail.svg' import time diff --git a/galleries/examples/event_handling/pong_sgskip.py b/galleries/examples/event_handling/pong_sgskip.py index 2c4c35a7cb35..2893634b48d7 100644 --- a/galleries/examples/event_handling/pong_sgskip.py +++ b/galleries/examples/event_handling/pong_sgskip.py @@ -14,6 +14,7 @@ You can copy and paste individual parts, or download the entire example using the link at the bottom of the page. """ +# sphinx_gallery_thumbnail_path = '_static/pong_sgskip_thumbnail.svg' import time diff --git a/galleries/examples/misc/hyperlinks_sgskip.py b/galleries/examples/misc/hyperlinks_sgskip.py index 26421c941573..4fc58d47483b 100644 --- a/galleries/examples/misc/hyperlinks_sgskip.py +++ b/galleries/examples/misc/hyperlinks_sgskip.py @@ -8,6 +8,7 @@ This currently only works with the SVG backend. """ +# sphinx_gallery_thumbnail_path = '_static/hyperlinks_sgskip_thumbnail.svg' import matplotlib.pyplot as plt diff --git a/galleries/examples/misc/image_thumbnail_sgskip.py b/galleries/examples/misc/image_thumbnail_sgskip.py index e361d3bf53ab..6c231cbe38e6 100644 --- a/galleries/examples/misc/image_thumbnail_sgskip.py +++ b/galleries/examples/misc/image_thumbnail_sgskip.py @@ -9,6 +9,7 @@ .. _Pillow: https://python-pillow.github.io """ +# sphinx_gallery_thumbnail_path = '_static/stinkbug.png' from argparse import ArgumentParser from pathlib import Path diff --git a/galleries/examples/misc/multiprocess_sgskip.py b/galleries/examples/misc/multiprocess_sgskip.py index 5951dab1b895..ed4dc92f8026 100644 --- a/galleries/examples/misc/multiprocess_sgskip.py +++ b/galleries/examples/misc/multiprocess_sgskip.py @@ -8,6 +8,7 @@ Written by Robert Cimrman """ +# sphinx_gallery_thumbnail_path = '_static/multiprocess_sgskip_thumbnail.svg' import multiprocessing as mp import time diff --git a/galleries/examples/misc/print_stdout_sgskip.py b/galleries/examples/misc/print_stdout_sgskip.py index 9c9848a73d9c..53bac16090f9 100644 --- a/galleries/examples/misc/print_stdout_sgskip.py +++ b/galleries/examples/misc/print_stdout_sgskip.py @@ -8,6 +8,7 @@ usage: python print_stdout.py > somefile.png """ +# sphinx_gallery_thumbnail_path = '_static/print_stdout_sgskip_thumbnail.svg' import sys diff --git a/galleries/examples/mplot3d/wire3d_animation_sgskip.py b/galleries/examples/mplot3d/wire3d_animation_sgskip.py index 903ff4918586..45be39117e21 100644 --- a/galleries/examples/mplot3d/wire3d_animation_sgskip.py +++ b/galleries/examples/mplot3d/wire3d_animation_sgskip.py @@ -8,6 +8,7 @@ (This example is skipped when building the documentation gallery because it intentionally takes a long time to run.) """ +# sphinx_gallery_thumbnail_path = '_static/demo_mplot3d.png' import time diff --git a/galleries/examples/widgets/lasso_selector_demo_sgskip.py b/galleries/examples/widgets/lasso_selector_demo_sgskip.py index fd2459be4f4f..951e63482611 100644 --- a/galleries/examples/widgets/lasso_selector_demo_sgskip.py +++ b/galleries/examples/widgets/lasso_selector_demo_sgskip.py @@ -9,6 +9,7 @@ a lasso loop around the points on the graph. To draw, just click on the graph, hold, and drag it around the points you need to select. """ +# sphinx_gallery_thumbnail_path = '_static/lasso_selector_sgskip_thumbnail.svg' import numpy as np