Skip to content

Commit

Permalink
Respect stroke width on markers in the Ps backend
Browse files Browse the repository at this point in the history
  • Loading branch information
mdboom committed Feb 29, 2012
1 parent d7ed6e6 commit 8ca2879
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions lib/matplotlib/backends/backend_ps.py
Original file line number Diff line number Diff line change
Expand Up @@ -591,20 +591,28 @@ def draw_markers(self, gc, marker_path, marker_trans, path, trans, rgbFace=None)

# construct the generic marker command:
ps_cmd = ['/o {', 'gsave', 'newpath', 'translate'] # dont want the translate to be global
jint = gc.get_joinstyle()
ps_cmd.append('%d setlinejoin' % jint)
cint = gc.get_capstyle()
ps_cmd.append('%d setlinecap' % cint)

lw = gc.get_linewidth()
stroke = lw != 0.0
if stroke:
ps_cmd.append('%.1f setlinewidth' % lw)
jint = gc.get_joinstyle()
ps_cmd.append('%d setlinejoin' % jint)
cint = gc.get_capstyle()
ps_cmd.append('%d setlinecap' % cint)

ps_cmd.append(self._convert_path(marker_path, marker_trans,
simplify=False))

if rgbFace:
ps_cmd.extend(['gsave', ps_color, 'fill', 'grestore'])
if gc.shouldstroke():
ps_cmd.append('stroke')
if stroke:
ps_cmd.append('gsave')
ps_cmd.extend([ps_color, 'fill'])
if stroke:
ps_cmd.append('grestore')

ps_cmd.extend(['grestore', '} bind def'])
if stroke:
ps_cmd.append('stroke')

for vertices, code in path.iter_segments(trans, simplify=False):
if len(vertices):
Expand Down

0 comments on commit 8ca2879

Please sign in to comment.