lib/matplotlib/backends/backend_ps.py
def _draw_ps(self, ps, gc, rgbFace, fill=True, stroke=True, command=None):
        """
        Emit the PostScript sniplet 'ps' with all the attributes from 'gc'
        applied.  'ps' must consist of PostScript commands to construct a path.

        The fill and/or stroke kwargs can be set to False if the
        'ps' string already includes filling and/or stroking, in
        which case _draw_ps is just supplying properties and
        clipping.
        """
        # local variable eliminates all repeated attribute lookups
        write = self._pswriter.write
        if debugPS and command:
            write("% "+command+"\n")
        mightstroke = (gc.get_linewidth() > 0.0 and
                  (len(gc.get_rgb()) <= 3 or gc.get_rgb()[3] != 0.0))
        stroke = stroke and mightstroke
        fill = (fill and rgbFace is not None and
                (len(rgbFace) <= 3 or rgbFace[3] != 0.0))

        if mightstroke:
            self.set_linewidth(gc.get_linewidth())
            jint = gc.get_joinstyle()
            self.set_linejoin(jint)
            cint = gc.get_capstyle()
            self.set_linecap(cint)
            self.set_linedash(*gc.get_dashes())
            self.set_color(*gc.get_rgb()[:3])
        write('gsave\n')

        cliprect = gc.get_clip_rectangle()
        if cliprect:
            x,y,w,h=cliprect.bounds
            write('%1.4g %1.4g %1.4g %1.4g clipbox\n' % (w,h,x,y))
        clippath, clippath_trans = gc.get_clip_path()
        if clippath:
            id = self._get_clip_path(clippath, clippath_trans)
            write('%s\n' % id)

        # Jochen, is the strip necessary? - this could be a honking big string
        write(ps.strip())
        write("\n")

        if fill:
            if stroke:
                write("gsave\n")
            self.set_color(store=0, *rgbFace[:3])
            write("fill\n")
            if stroke:
                write("grestore\n")

        hatch = gc.get_hatch()
        if hatch:
            hatch_name = self.create_hatch(hatch)
            write("gsave\n")
            write("[/Pattern [/DeviceRGB]] setcolorspace %f %f %f " % gc.get_rgb()[:3])
            write("%s setcolor fill grestore\n" % hatch_name)

        if stroke:
            write("stroke\n")

        write("grestore\n")

        Emit the PostScript sniplet 'ps' with all the attributes from 'gc'
        applied.  'ps' must consist of PostScript commands to construct a path.

        The fill and/or stroke kwargs can be set to False if the
        'ps' string already includes filling and/or stroking, in
        which case _draw_ps is just supplying properties and
        clipping.
        
Emit the PostScript sniplet 'ps' with all the attributes from 'gc'
applied.  'ps' must consist of PostScript commands to construct a path.

The fill and/or stroke kwargs can be set to False if the
'ps' string already includes filling and/or stroking, in
which case _draw_ps is just supplying properties and
clipping.
Emit the PostScript sniplet ' ps ' with all the attributes from ' gc ' applied . ' ps ' must consist of PostScript commands to construct a path . The fill and / or stroke kwargs can be set to False if the ' ps ' string already includes filling and / or stroking in which case _draw_ps is just supplying properties and clipping .
def _draw_ps(self, ps, gc, rgbFace, fill=True, stroke=True, command=None):
        write = self._pswriter.write
        if debugPS and command:
            write("% "+command+"\n")
        mightstroke = (gc.get_linewidth() > 0.0 and
                  (len(gc.get_rgb()) <= 3 or gc.get_rgb()[3] != 0.0))
        stroke = stroke and mightstroke
        fill = (fill and rgbFace is not None and
                (len(rgbFace) <= 3 or rgbFace[3] != 0.0))
        if mightstroke:
            self.set_linewidth(gc.get_linewidth())
            jint = gc.get_joinstyle()
            self.set_linejoin(jint)
            cint = gc.get_capstyle()
            self.set_linecap(cint)
            self.set_linedash(*gc.get_dashes())
            self.set_color(*gc.get_rgb()[:3])
        write('gsave\n')
        cliprect = gc.get_clip_rectangle()
        if cliprect:
            x,y,w,h=cliprect.bounds
            write('%1.4g %1.4g %1.4g %1.4g clipbox\n' % (w,h,x,y))
        clippath, clippath_trans = gc.get_clip_path()
        if clippath:
            id = self._get_clip_path(clippath, clippath_trans)
            write('%s\n' % id)
        write(ps.strip())
        write("\n")
        if fill:
            if stroke:
                write("gsave\n")
            self.set_color(store=0, *rgbFace[:3])
            write("fill\n")
            if stroke:
                write("grestore\n")
        hatch = gc.get_hatch()
        if hatch:
            hatch_name = self.create_hatch(hatch)
            write("gsave\n")
            write("[/Pattern [/DeviceRGB]] setcolorspace %f %f %f " % gc.get_rgb()[:3])
            write("%s setcolor fill grestore\n" % hatch_name)
        if stroke:
            write("stroke\n")
        write("grestore\n")
def _draw_ps ( self , ps , gc , rgbFace , fill = True , stroke = True , command = None ) : write = self . _pswriter . write if debugPS and command : write ( "% " + command + "\n" ) mightstroke = ( gc . get_linewidth ( ) > 0.0 and ( len ( gc . get_rgb ( ) ) <= 3 or gc . get_rgb ( ) [ 3 ] != 0.0 ) ) stroke = stroke and mightstroke fill = ( fill and rgbFace is not None and ( len ( rgbFace ) <= 3 or rgbFace [ 3 ] != 0.0 ) ) if mightstroke : self . set_linewidth ( gc . get_linewidth ( ) ) jint = gc . get_joinstyle ( ) self . set_linejoin ( jint ) cint = gc . get_capstyle ( ) self . set_linecap ( cint ) self . set_linedash ( * gc . get_dashes ( ) ) self . set_color ( * gc . get_rgb ( ) [ : 3 ] ) write ( 'gsave\n' ) cliprect = gc . get_clip_rectangle ( ) if cliprect : x , y , w , h = cliprect . bounds write ( '%1.4g %1.4g %1.4g %1.4g clipbox\n' % ( w , h , x , y ) ) clippath , clippath_trans = gc . get_clip_path ( ) if clippath : id = self . _get_clip_path ( clippath , clippath_trans ) write ( '%s\n' % id ) write ( ps . strip ( ) ) write ( "\n" ) if fill : if stroke : write ( "gsave\n" ) self . set_color ( store = 0 , * rgbFace [ : 3 ] ) write ( "fill\n" ) if stroke : write ( "grestore\n" ) hatch = gc . get_hatch ( ) if hatch : hatch_name = self . create_hatch ( hatch ) write ( "gsave\n" ) write ( "[/Pattern [/DeviceRGB]] setcolorspace %f %f %f " % gc . get_rgb ( ) [ : 3 ] ) write ( "%s setcolor fill grestore\n" % hatch_name ) if stroke : write ( "stroke\n" ) write ( "grestore\n" )
Emit the PostScript sniplet 'ps' with all the attributes from 'gc'
applied.
Emit the PostScript sniplet ' ps ' with all the attributes from ' gc ' applied .
"""
        Emit the PostScript sniplet 'ps' with all the attributes from 'gc'
        applied.  'ps' must consist of PostScript commands to construct a path.

        The fill and/or stroke kwargs can be set to False if the
        'ps' string already includes filling and/or stroking, in
        which case _draw_ps is just supplying properties and
        clipping.
        """ # local variable eliminates all repeated attribute lookups # Jochen, is the strip necessary? - this could be a honking big string
self
ps
gc
rgbFace
fill
stroke
command