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

Skip to content

Commit 5f654dc

Browse files
committed
Fix PDFpages bug
1 parent df1af2f commit 5f654dc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/matplotlib/backends/backend_pdf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2591,7 +2591,8 @@ def print_pdf(self, filename, **kwargs):
25912591
bbox_inches_restore=_bbox_inches_restore)
25922592
self.figure.draw(renderer)
25932593
renderer.finalize()
2594-
file.finalize()
2594+
if not isinstance(filename, PdfPages):
2595+
file.finalize()
25952596
finally:
25962597
if isinstance(filename, PdfPages): # finish off this page
25972598
file.endStream()

0 commit comments

Comments
 (0)