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

Skip to content

Commit fc52db6

Browse files
author
Ulrich Dobramysl
committed
Add optional positionRect argument to the PdfPages.attach_note method to be able to specify the new note's position.
1 parent 4fa8a0a commit fc52db6

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

lib/matplotlib/backends/backend_pdf.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2463,11 +2463,14 @@ def get_pagecount(self):
24632463
"""
24642464
return len(self._file.pageList)
24652465

2466-
def attach_note(self, text):
2466+
def attach_note(self, text, positionRect=[-100, -100, 0, 0]):
24672467
"""
2468-
Add a new text note to the page to be saved next.
2468+
Add a new text note to the page to be saved next. The optional
2469+
positionRect specifies the position of the new note on the
2470+
page. It is outside the page per default to make sure it is
2471+
invisible on printouts.
24692472
"""
2470-
self._file.newTextnote(text)
2473+
self._file.newTextnote(text, positionRect)
24712474

24722475

24732476
class FigureCanvasPdf(FigureCanvasBase):

0 commit comments

Comments
 (0)