From 43cebd65455d62eb6b5f4048e5258f6b4d6598fd Mon Sep 17 00:00:00 2001 From: Matthew Brett Date: Sat, 31 Oct 2015 21:02:11 -0400 Subject: [PATCH] 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. --- lib/matplotlib/sphinxext/plot_directive.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/sphinxext/plot_directive.py b/lib/matplotlib/sphinxext/plot_directive.py index 99ddec34e3ff..cc89f4635ce8 100644 --- a/lib/matplotlib/sphinxext/plot_directive.py +++ b/lib/matplotlib/sphinxext/plot_directive.py @@ -812,7 +812,7 @@ def run(arguments, content, options, state_machine, state, lineno): options=opts, images=images, source_code=source_code, - html_show_formats=config.plot_html_show_formats and not nofigs, + html_show_formats=config.plot_html_show_formats and len(images), caption=caption) total_lines.extend(result.split("\n"))