Skip to content

Commit 043eef2

Browse files
committed
PDF bugfixes
svn path=/trunk/matplotlib/; revision=2527
1 parent 87b9d47 commit 043eef2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/matplotlib/backends/backend_pdf.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,10 @@ def draw_polygon(self, gcEdge, rgbFace, points):
600600
pr(points[0][1])))
601601
for x,y in points[1:]:
602602
write('%s %s l\n' % (pr(x), pr(y)))
603-
write('q %s %s %s rg b Q\n' % tmap(pr, rgbFace))
603+
if rgbFace is None:
604+
write('s\n')
605+
else:
606+
write('q %s %s %s rg b Q\n' % tmap(pr, rgbFace))
604607

605608
def draw_rectangle(self, gcEdge, rgbFace, x, y, width, height):
606609
# TODO: be smarter about gc (include rgbFace in it?)
@@ -686,7 +689,8 @@ def linewidth_cmd(self, width):
686689
return '%s w' % pdfRepr(width)
687690

688691
def dash_cmd(self, dashes):
689-
offset, dash = GraphicsContextPdf.dashd[style]
692+
offset, dash = dashes
693+
if dash is None: dash = []
690694
return '%s %s d' % (pdfRepr(list(dash)), offset)
691695

692696
def alpha_cmd(self, alpha):

0 commit comments

Comments
 (0)