Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 43cebd6

Browse files
committed
RF: fix annoying parens bug
When there are no images generated but plots are configured to show different plot formats, the plot directive generates an annoying empty parens in the output. Fix.
1 parent eb5f56e commit 43cebd6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/matplotlib/sphinxext/plot_directive.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,7 @@ def run(arguments, content, options, state_machine, state, lineno):
812812
options=opts,
813813
images=images,
814814
source_code=source_code,
815-
html_show_formats=config.plot_html_show_formats and not nofigs,
815+
html_show_formats=config.plot_html_show_formats and len(images),
816816
caption=caption)
817817

818818
total_lines.extend(result.split("\n"))

0 commit comments

Comments
 (0)