Scrapers for embedding images

Collect images that have been produced by code blocks.

The only scrapers we support are Matplotlib and Mayavi, others should live in modules that will support them (e.g., PyVista, Plotly).


sphinx_gallery.scrapers.clean_modules(gallery_conf, fname)[source]

Remove, unload, or reset modules after running each example.

After a script is executed it can load a variety of settings that one does not want to influence in other examples in the gallery.

  • gallery_conf (dict) – The gallery configuration.

  • fname (str or None) – The example being run. Will be None when this is called entering a directory of examples to be built.


class sphinx_gallery.scrapers.ImagePathIterator(image_path)[source]

Iterate over image paths for a given example.


image_path (str) – The template image path.