Skip to content

Commit 5cbff83

Browse files
authored
Merge pull request #13633 from mgeier/plot_directive-png-warning
FIX: Avoid warning if plot_formats doesn't contain 'png'
2 parents 2a282ca + db2a3b5 commit 5cbff83

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/matplotlib/sphinxext/plot_directive.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,11 +419,13 @@ def remove_coding(text):
419419
{{ only_texinfo }}
420420
421421
{% for img in images %}
422+
{% if 'png' in img.formats -%}
422423
.. image:: {{ build_dir }}/{{ img.basename }}.png
423424
{% for option in options -%}
424425
{{ option }}
425426
{% endfor %}
426427
428+
{% endif -%}
427429
{% endfor %}
428430
429431
"""

0 commit comments

Comments
 (0)