Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9285cec

Browse files
committed
Fix problem with color changing in Ps backend. (Ticks were same color
as line). Thanks Paul Novak. svn path=/trunk/matplotlib/; revision=4870
1 parent 599caf6 commit 9285cec

1 file changed

Lines changed: 11 additions & 15 deletions

File tree

lib/matplotlib/backends/backend_ps.py

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -759,16 +759,6 @@ def _draw_ps(self, ps, gc, rgbFace, fill=True, stroke=True, command=None):
759759
fill = (fill and rgbFace is not None and
760760
(len(rgbFace) <= 3 or rgbFace[3] != 0.0))
761761

762-
if stroke:
763-
self.set_linewidth(gc.get_linewidth())
764-
jint = gc.get_joinstyle()
765-
self.set_linejoin(jint)
766-
cint = gc.get_capstyle()
767-
self.set_linecap(cint)
768-
self.set_linedash(*gc.get_dashes())
769-
if self.linewidth > 0 and stroke:
770-
self.set_color(*gc.get_rgb()[:3])
771-
772762
cliprect = gc.get_clip_rectangle()
773763
if cliprect:
774764
x,y,w,h=cliprect.bounds
@@ -782,17 +772,23 @@ def _draw_ps(self, ps, gc, rgbFace, fill=True, stroke=True, command=None):
782772
write(ps.strip())
783773
write("\n")
784774

775+
hatch = gc.get_hatch()
776+
if hatch:
777+
self.set_hatch(hatch)
778+
785779
if fill:
786780
#print 'rgbface', rgbFace
787781
write("gsave\n")
788782
self.set_color(store=0, *rgbFace[:3])
789783
write("fill\ngrestore\n")
790784

791-
hatch = gc.get_hatch()
792-
if (hatch):
793-
self.set_hatch(hatch)
794-
795-
if self.linewidth > 0 and stroke:
785+
if stroke and gc.get_linewidth() > 0.0:
786+
self.set_linewidth(gc.get_linewidth())
787+
jint = gc.get_joinstyle()
788+
self.set_linejoin(jint)
789+
cint = gc.get_capstyle()
790+
self.set_linecap(cint)
791+
self.set_linedash(*gc.get_dashes())
796792
self.set_color(*gc.get_rgb()[:3])
797793
write("stroke\n")
798794
else:

0 commit comments

Comments
 (0)