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

Skip to content

Commit f65281a

Browse files
author
Ulrich Dobramysl
committed
Include a pdf note in the multipage_pdf.py example. Document the PdfPages.attach_note method in the whats_new section.
1 parent fc52db6 commit f65281a

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Per-page pdf notes in multi-page pdfs (PdfPages)
2+
------------------------------------------------
3+
4+
Add a new method attach_note to the PdfPages class, allowing the
5+
attachment of simple text notes to pages in a multi-page pdf of
6+
figures. The new note is visible in the list of pdf annotations in a
7+
viewer that has this facility (Adobe Reader, OSX Preview, Skim,
8+
etc.). Per default the note itself is kept off-page to prevent it to
9+
appear in print-outs.
10+
11+
PdfPages.attach_note needs to be called before savefig in order to be
12+
added to the correct figure.

examples/pylab_examples/multipage_pdf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
x = np.arange(0, 5, 0.1)
2121
plt.plot(x, np.sin(x), 'b-')
2222
plt.title('Page Two')
23+
pdf.attach_note("plot of sin(x)") # you can add a pdf note to
24+
# attach metadata to a page
2325
pdf.savefig()
2426
plt.close()
2527

0 commit comments

Comments
 (0)