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

Skip to content

Commit 720e5a4

Browse files
committed
Don't create page transparency group in pdf output (for pdftex compat).
1 parent d235b02 commit 720e5a4

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lib/matplotlib/backends/backend_pdf.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -732,9 +732,6 @@ def newPage(self, width, height):
732732
'Resources': self.resourceObject,
733733
'MediaBox': [0, 0, 72 * width, 72 * height],
734734
'Contents': contentObject,
735-
'Group': {'Type': Name('Group'),
736-
'S': Name('Transparency'),
737-
'CS': Name('DeviceRGB')},
738735
'Annots': annotsObject,
739736
}
740737
pageObject = self.reserveObject('page')
@@ -744,8 +741,10 @@ def newPage(self, width, height):
744741

745742
self.beginStream(contentObject.id,
746743
self.reserveObject('length of content stream'))
747-
# Initialize the pdf graphics state to match the default mpl
748-
# graphics context: currently only the join style needs to be set
744+
# Initialize the pdf graphics state to match the default Matplotlib
745+
# graphics context (colorspace and joinstyle).
746+
self.output(Name('DeviceRGB'), Op.setcolorspace_stroke)
747+
self.output(Name('DeviceRGB'), Op.setcolorspace_nonstroke)
749748
self.output(GraphicsContextPdf.joinstyles['round'], Op.setlinejoin)
750749

751750
# Clear the list of annotations for the next page

0 commit comments

Comments
 (0)