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

Skip to content

Commit a051169

Browse files
authored
Merge pull request #19525 from anntzer/pdfgroup
Don't create page transparency group in pdf output (for pdftex compat).
2 parents 92ce41d + 720e5a4 commit a051169

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
@@ -728,9 +728,6 @@ def newPage(self, width, height):
728728
'Resources': self.resourceObject,
729729
'MediaBox': [0, 0, 72 * width, 72 * height],
730730
'Contents': contentObject,
731-
'Group': {'Type': Name('Group'),
732-
'S': Name('Transparency'),
733-
'CS': Name('DeviceRGB')},
734731
'Annots': annotsObject,
735732
}
736733
pageObject = self.reserveObject('page')
@@ -740,8 +737,10 @@ def newPage(self, width, height):
740737

741738
self.beginStream(contentObject.id,
742739
self.reserveObject('length of content stream'))
743-
# Initialize the pdf graphics state to match the default mpl
744-
# graphics context: currently only the join style needs to be set
740+
# Initialize the pdf graphics state to match the default Matplotlib
741+
# graphics context (colorspace and joinstyle).
742+
self.output(Name('DeviceRGB'), Op.setcolorspace_stroke)
743+
self.output(Name('DeviceRGB'), Op.setcolorspace_nonstroke)
745744
self.output(GraphicsContextPdf.joinstyles['round'], Op.setlinejoin)
746745

747746
# Clear the list of annotations for the next page

0 commit comments

Comments
 (0)