From db2a3b5e2f733d2bee84d66843e3f8ae1a145263 Mon Sep 17 00:00:00 2001 From: Matthias Geier Date: Fri, 8 Mar 2019 11:27:52 +0100 Subject: [PATCH] plot_directive: Avoid warning if plot_formats doesn't contain 'png' --- lib/matplotlib/sphinxext/plot_directive.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/matplotlib/sphinxext/plot_directive.py b/lib/matplotlib/sphinxext/plot_directive.py index 1ab5aa5e17dd..aa2cc6c6f564 100644 --- a/lib/matplotlib/sphinxext/plot_directive.py +++ b/lib/matplotlib/sphinxext/plot_directive.py @@ -419,11 +419,13 @@ def remove_coding(text): {{ only_texinfo }} {% for img in images %} + {% if 'png' in img.formats -%} .. image:: {{ build_dir }}/{{ img.basename }}.png {% for option in options -%} {{ option }} {% endfor %} + {% endif -%} {% endfor %} """