Add gallery thumbnails for examples missing them#31986
Conversation
Add sphinx_gallery_thumbnail_path for multiple gallery examples that were missing thumbnails because they use sgskip or don't produce standard matplotlib figures. Closes matplotlib#17479
|
Thank you for opening your first PR into Matplotlib! If you have not heard from us in a week or so, please leave a new comment below and that should bring it to our attention. Most of our reviewers are volunteers and sometimes things fall through the cracks. We also ask that you please finish addressing any review comments on this PR and wait for it to be merged (or closed) before opening a new one, as it can be a valuable learning experience to go through the review process. You can also join us on discourse chat for real-time discussion. For details on testing, writing docs, and our review process, please see the developer guide. We strive to be a welcoming and open project. Please follow our Code of Conduct. |
timhoffm
left a comment
There was a problem hiding this comment.
Please use our PR template, in particular state the use of AI if applicable.
| # sphinx_gallery_thumbnail_path = "_static/frame_grabbing.png" | ||
| """ |
There was a problem hiding this comment.
| # sphinx_gallery_thumbnail_path = "_static/frame_grabbing.png" | |
| """ | |
| """ | |
| # sphinx_gallery_thumbnail_path = "_static/frame_grabbing.png" |
The comment must be in the code not in the docstring.
|
Could you take a pass through the examples and see if others are missing? For example, https://matplotlib.org/stable/gallery/mplot3d/rotate_axes3d_sgskip.html also does not have a thumbnail |
Can you explain this b/c most of our animation examples produce a thumbnail? Also, can you explain how you think your images illustrate the example they're for? |
…es3d_sgskip thumbnail
This comment was marked as outdated.
This comment was marked as outdated.
…ails Adds thumbnails for sgskip examples and non-figure-producing examples that are missing auto-generated gallery thumbnails. Partially addresses matplotlib#17479
|
Thanks everyone for the reviews! I've cleaned up the PR quite a bit based on the feedback: @timhoffm — You're right about the PR template and AI disclosure. I've updated the PR description now to follow the template properly and added an AI disclosure statement. Thanks for noting that. @scottshambaugh — I added the @story645 — Great questions:
I've also rebased the branch to keep only the thumbnail additions — no more accidental rewrites of the example code. All 10 files now contain only their original content plus the thumbnail path. Let me know if there's anything else that needs to be addressed! |
|
Hi @harshitnagar22, please do not use AI to write your comments except for direct translation. We would much prefer to see your thoughts without AI "polish" |
|
@scottshambaugh Got it, and sorry about that. I’ll make sure to write the comments in my own words from now on. Please let me know if there’s anything else you’d like me to change in the PR. |
… better conceptual clarity
|
@story645 — thanks for the feedback! I've updated the weak thumbnails for |
|
Please make sure images are minified. We serve a lot of thumbnails on the examples page and don’t want to create more traffic than necessary. Use optipng, which is used internally for the rendered example plots, or manually minify through a separate tool such as https://tinypng.com/ |
|
The Lasso selector image should have a visible lasso |
|
Generally, it would be good to have a way to recreate/modify the images later. Please consider how that could be supported, e.g. through a short description/script as a comment in the example sources? |
…d Minified all 9 PNG thumbnails to reduce file sizes
|
@timhoffm Thanks for the feedback! I took another pass over the thumbnails and made a few updates:
Let me know if these work better or if you'd like any further adjustments. |
I think the images are still a bit disconnected from the point of the figure and adding extraneous information (what does kerning have to do w/ font index? what about multiprocessing shows multiprocessing?) And the figures lack the scripts/prompts to reproduce them. |


PR summary
Went through the gallery examples one by one to find ones that were missing thumbnails. These were mostly
_sgskipfiles (not executed during doc build) and a couple of regular examples that don't produce standard matplotlib figures. Addedsphinx_gallery_thumbnail_pathto each one.10 Python files modified:
galleries/examples/animation/frame_grabbing_sgskip.py_static/frame_grabbing.pnggalleries/examples/event_handling/ginput_manual_clabel_sgskip.py_static/ginput_manual_clabel.pnggalleries/examples/event_handling/pong_sgskip.py_static/pong.pnggalleries/examples/misc/font_indexing.py_static/font_indexing.pnggalleries/examples/misc/hyperlinks_sgskip.py_static/hyperlinks.pnggalleries/examples/misc/multiprocess_sgskip.py_static/multiprocess.pnggalleries/examples/misc/print_stdout_sgskip.py_static/print_stdout.pnggalleries/examples/mplot3d/rotate_axes3d_sgskip.py_static/rotate_axes3d.pnggalleries/examples/mplot3d/wire3d_animation.py_static/wire3d_animation.pnggalleries/examples/widgets/lasso_selector_demo_sgskip.py_static/lasso_selector_demo.png10 new thumbnail images added to
doc/_static/.Partially addresses #17479 (adds thumbnails for ~10 of the ~25 examples/tutorials listed).
AI Disclosure
Went through the gallery examples one by one, identified the ones missing thumbnails, and added paths manually. AI helped with initial exploration and catching inconsistencies during the review cycle.
PR checklist