Skip to content

Commit e4da584

Browse files
authored
Merge pull request #6327 from jarrodmillman/latex_figure_caption
Fix: captions for plot directive in latex target
2 parents a63463f + 9664046 commit e4da584

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/matplotlib/sphinxext/plot_directive.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,12 @@ def remove_coding(text):
398398
399399
{% for img in images %}
400400
{% if 'pdf' in img.formats -%}
401-
.. image:: {{ build_dir }}/{{ img.basename }}.pdf
401+
.. figure:: {{ build_dir }}/{{ img.basename }}.pdf
402+
{% for option in options -%}
403+
{{ option }}
404+
{% endfor %}
405+
406+
{{ caption }}
402407
{% endif -%}
403408
{% endfor %}
404409

0 commit comments

Comments
 (0)