diff --git a/CHANGELOG b/CHANGELOG
index 1369718afb92..2f94445e3359 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+2011-12-29 ps and pdf markers are now stroked only if the line width
+ is nonzero for consistency with agg, fixes issue #621. - JKS
+
2011-10-25 added support for \operatorname to mathtext,
including the ability to insert spaces, such as
$\operatorname{arg\,max}$ - PI
diff --git a/lib/matplotlib/backends/backend_ps.py b/lib/matplotlib/backends/backend_ps.py
index a4bcc2d16882..b5829ba3b5b1 100644
--- a/lib/matplotlib/backends/backend_ps.py
+++ b/lib/matplotlib/backends/backend_ps.py
@@ -593,8 +593,10 @@ def draw_markers(self, gc, marker_path, marker_trans, path, trans, rgbFace=None)
if rgbFace:
ps_cmd.extend(['gsave', ps_color, 'fill', 'grestore'])
+ if gc.shouldstroke():
+ ps_cmd.append('stroke')
- ps_cmd.extend(['stroke', 'grestore', '} bind def'])
+ ps_cmd.extend(['grestore', '} bind def'])
for vertices, code in path.iter_segments(trans, simplify=False):
if len(vertices):
@@ -855,8 +857,7 @@ 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))
+ mightstroke = gc.shouldstroke()
stroke = stroke and mightstroke
fill = (fill and rgbFace is not None and
(len(rgbFace) <= 3 or rgbFace[3] != 0.0))
@@ -917,6 +918,9 @@ def get_joinstyle(self):
'round':1,
'bevel':2}[GraphicsContextBase.get_joinstyle(self)]
+ def shouldstroke(self):
+ return (self.get_linewidth() > 0.0 and
+ (len(self.get_rgb()) <= 3 or self.get_rgb()[3] != 0.0))
def new_figure_manager(num, *args, **kwargs):
FigureClass = kwargs.pop('FigureClass', Figure)