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

Skip to content

Commit db2a3b5

Browse files
committed
plot_directive: Avoid warning if plot_formats doesn't contain 'png'
1 parent 22bbbae commit db2a3b5

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)