@@ -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