Skip to content

Fix single pixel markers #695

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Feb 29, 2012
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Respect stroke width on markers in the Ps backend
  • Loading branch information
mdboom committed Feb 29, 2012
commit fabf327b03bb162b009be0e4945a0d11ca10f14d
23 changes: 17 additions & 6 deletions lib/matplotlib/backends/backend_ps.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,18 +582,29 @@ 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 stroke:
ps_cmd.append('gsave')
ps_cmd.extend([ps_color, 'fill'])
if stroke:
ps_cmd.append('grestore')

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

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