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

Skip to content

Commit 4e55172

Browse files
committed
Add docs for backend_pgf.PdfPages
1 parent 8bfe11e commit 4e55172

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

tutorials/text/pgf.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,30 @@
5656
5757
.. _pgf-rcfonts:
5858
59+
60+
Multi-Page PDF Files
61+
====================
62+
63+
The pgf backend also supportes multipage pdf files using ``PdfPages``
64+
65+
.. code-block:: python
66+
67+
from matplotlib.backends.backend_pgf import PdfPages
68+
import matplotlib.pyplot as plt
69+
70+
with PdfPages('multipage.pdf', metadata={'author': 'Me'}) as pdf:
71+
72+
fig1 = plt.figure()
73+
ax1 = fig1.add_subplot(1, 1, 1)
74+
ax1.plot([1, 5, 3])
75+
pdf.savefig(fig1)
76+
77+
fig2 = plt.figure()
78+
ax2 = fig2.add_subplot(1, 1, 1)
79+
ax2.plot([1, 5, 3])
80+
pdf.savefig(fig2)
81+
82+
5983
Font specification
6084
==================
6185

0 commit comments

Comments
 (0)