Skip to content

Commit 54450fd

Browse files
committed
Handle negative offsets in dash patterns
I think the pdf specification implies that the offset should be nonnegative.
1 parent 08b64e4 commit 54450fd

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎lib/matplotlib/backends/backend_pdf.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2215,6 +2215,8 @@ def linewidth_dash_cmd(self, width, dashes):
22152215
if offset is None or dash is None:
22162216
dash = []
22172217
offset = 0
2218+
if sum(dash) > 0:
2219+
offset %= sum(dash)
22182220
result += [list(dash), offset, Op.setdash]
22192221
return result
22202222

0 commit comments

Comments
 (0)