Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

sphinx-extensions2/sphinx-subfigure

Open more actions menu

Repository files navigation

sphinx-subfigure

PyPI

A sphinx extension to create figures with multiple images:

  • Provides a simple format for complex image layouts.
  • Supports HTML fully, with responsive layouts, for different screen sizes
    • LaTeX is supported, except for images that span multiple rows.
    • degrades gracefully for other formats.
  • Supports figure numbering and referencing.
  • Supports image sub-captions, via alt text.

Usage

Install sphinx-subfigure with pip install sphinx-subfigure, then add sphinx_subfigure to your conf.py file's extensions variable:

extensions = ["sphinx_subfigure"]

numfig = True  # optional

Now add a subfigure directive to your document:

.. subfigure:: AA|BC
   :layout-sm: A|B|C
   :subcaptions: above
   :name: myfigure
   :class-grid: outline

   .. image:: imageA.png
      :alt: Image A

   .. image:: imageB.png
      :alt: Image B

   .. image:: imageC.png
      :alt: Image C

    Figure Caption
  1. Each image is automatically assigned an area identifier (A, B, C, etc.).
  2. Layouts are formed by composing the areas into a grid, with rows delimited by |.
  3. Each area must be used exactly once in the layout, and form a single rectangle.
  4. "Empty" areas can be designated with .
  5. Spaces in the layout are ignored, so they can be used for visual alignment.
  6. Additional layouts can be defined with :layout-sm:, :layout-lg:, :layout-xl:, and :layout-xxl:, for different screen sizes (HTML only).

Responsive sub-figure

About

A sphinx extension to create figures with multiple images

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.