MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / writeMarkers

Method writeMarkers

lib/matplotlib/backends/backend_pdf.py:1753–1773  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1751 return name
1752
1753 def writeMarkers(self):
1754 for ((pathops, fill, stroke, joinstyle, capstyle),
1755 (name, ob, bbox, lw)) in self.markers.items():
1756 # bbox wraps the exact limits of the control points, so half a line
1757 # will appear outside it. If the join style is miter and the line
1758 # is not parallel to the edge, then the line will extend even
1759 # further. From the PDF specification, Section 8.4.3.5, the miter
1760 # limit is miterLength / lineWidth and from Table 52, the default
1761 # is 10. With half the miter length outside, that works out to the
1762 # following padding:
1763 bbox = bbox.padded(lw * 5)
1764 self.beginStream(
1765 ob.id, None,
1766 {'Type': Name('XObject'), 'Subtype': Name('Form'),
1767 'BBox': list(bbox.extents)})
1768 self.output(GraphicsContextPdf.joinstyles[joinstyle],
1769 Op.setlinejoin)
1770 self.output(GraphicsContextPdf.capstyles[capstyle], Op.setlinecap)
1771 self.output(*pathops)
1772 self.output(Op.paint_path(fill, stroke))
1773 self.endStream()
1774
1775 def pathCollectionObject(self, gc, path, trans, padding, filled, stroked):
1776 name = Name('P%d' % len(self.paths))

Callers 1

finalizeMethod · 0.95

Calls 6

beginStreamMethod · 0.95
outputMethod · 0.95
endStreamMethod · 0.95
NameClass · 0.85
paddedMethod · 0.80
paint_pathMethod · 0.80

Tested by

no test coverage detected