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