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

Add a filename-prefix option to the Sphinx plot directive#28187

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
timhoffm merged 24 commits intomatplotlib:mainfromasmeurer:output-base-name
Jun 16, 2025
Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
Show all changes
24 commits
Select commitHold shift + click to select a range
615017a
Add an output-base-name option to the Sphinx plot directive
asmeurerMay 8, 2024
b432962
Add tests for output-base-name
asmeurerMay 9, 2024
426abc7
Remove {counter} from output-base-name and remove the global config
asmeurerOct 11, 2024
8485bfd
Check for duplicate output-base-name in the Sphinx extension
asmeurerOct 11, 2024
f94a932
Fix flake8 errors
asmeurerOct 12, 2024
19daf49
Merge branch 'main' into output-base-name
asmeurerOct 12, 2024
8f05ba6
Make an internal class private
asmeurerOct 12, 2024
1fa88dd
Fix small code nit
asmeurerOct 14, 2024
a22fcc3
Add a test for output-base-name with a .py file
asmeurerOct 14, 2024
86fb167
Remove a redundant test
asmeurerOct 17, 2024
e0be21e
Disallow / or . in output-base-name
asmeurerOct 17, 2024
f322125
Rename output-base-name to image-basename
asmeurerOct 18, 2024
fc33c38
Use a better variable name
asmeurerOct 21, 2024
7d416cf
Simplify logic in merge_other
asmeurerOct 21, 2024
ce23c88
Merge branch 'main' into output-base-name
asmeurerFeb 24, 2025
f654a74
Various small code cleanups from review
asmeurerJun 6, 2025
13e5291
Merge branch 'main' into output-base-name
asmeurerJun 6, 2025
20bed26
Add a test for image-basename with multiple figures
asmeurerJun 6, 2025
7f56c94
Disallow \ in output_base in the plot directive
asmeurerJun 6, 2025
550e382
Fix the source link when using a custom basename to include the .py e…
asmeurerJun 6, 2025
d4f2440
Make the sphinx extension tests more robust to manually building the …
asmeurerJun 6, 2025
bab3aaf
Use shutil.ignore_patterns
asmeurerJun 6, 2025
c8eba90
Rename image-basename to filename-prefix
asmeurerJun 8, 2025
f4f1fbf
Merge branch 'main' into output-base-name
asmeurerJun 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
Add a test for image-basename with multiple figures
  • Loading branch information
@asmeurer
asmeurer committedJun 6, 2025
commit20bed265798c1ac62229235ced8ca286154b6b09
11 changes: 10 additions & 1 deletionlib/matplotlib/tests/data/tinypages/some_plots.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -180,7 +180,7 @@ Plot 22 uses a different specific function in a file with plot commands:

.. plot:: range6.py range10

Plots 23 and 24 use image-basename.
Plots 23--25 use image-basename.

.. plot::
:image-basename: custom-basename-6
Expand All@@ -189,3 +189,12 @@ Plots 23 and 24 use image-basename.

.. plot:: range4.py
:image-basename: custom-basename-4

.. plot::
:image-basename: custom-basename-4-6

plt.figure()
plt.plot(range(4))

plt.figure()
plt.plot(range(6))
4 changes: 3 additions & 1 deletionlib/matplotlib/tests/test_sphinxext.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -92,9 +92,11 @@ def plot_directive_file(num):
assert filecmp.cmp(range_6, plot_file(17))
# plot 22 is from the range6.py file again, but a different function
assert filecmp.cmp(range_10, img_dir / 'range6_range10.png')
# plots 23 and 24 use a custom basename
# plots 23--25 use a custom basename
assert filecmp.cmp(range_6, img_dir / 'custom-basename-6.png')
assert filecmp.cmp(range_4, img_dir / 'custom-basename-4.png')
assert filecmp.cmp(range_4, img_dir / 'custom-basename-4-6_00.png')
assert filecmp.cmp(range_6, img_dir / 'custom-basename-4-6_01.png')

# Modify the included plot
contents = (tmp_path / 'included_plot_21.rst').read_bytes()
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp