Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

[Bug]: Plot directive clutters the output directory with unneeded files #24005

Open
@MikhailRyazanov

Description

@MikhailRyazanov

Bug summary

Using the Matplotlib plot directive in Sphinx documentation results in cluttering the output directory with all the produced image files in all generated formats even when they are not needed (plot_html_show_formats = False). This is especially obvious with thesinglehtml builder, where all the necessary images must be inside the_images subdirectory, but in fact, in addition to_images, the whole directory tree with every image in every format is copied to the output directory, although nothing of it is referenced from the HTML file.

What is more interesting, if another builder is executed first, then its cached images are reused properly — only the necessary files are copied into_images, without cluttering the output directory with unneeded files and subdirectories.

Code for reproduction

See a minimal working example athttps://github.com/MikhailRyazanov/plot-clutter.

Actual outcome

From step 1 of the example above:

$ tree build/singlehtmlbuild/singlehtml├── _images│   ├── index-1.svg│   ├── other-1.svg│   └── script.svg├── index-1.pdf├── index-1.svg├── index.html├── objects.inv├── _static│   <skipped>└── subdir    ├── other-1.pdf    ├── other-1.svg    ├── script.pdf    └── script.svg

Expected outcome

From step 2 of the example above:

build/singlehtml├── _images│   ├── index-1.svg│   ├── other-1.svg│   └── script.svg├── index.html├── objects.inv└── _static    <skipped>

Additional information

In practice, this undesired behavior directly affects the downloadable documentation at Read the docs — seeissue #9068 there.

Operating system

No response

Matplotlib Version

3.5.2

Matplotlib Backend

No response

Python version

No response

Jupyter version

No response

Installation

Linux package manager

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp