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 %} """