MCPcopy Create free account
hub / github.com/antirez/ds4 / points_to_polyline

Function points_to_polyline

speed-bench/plot_speed.py:89–98  ·  view source on GitHub ↗
(points, x_min, x_max, y_max, plot)

Source from the content-addressed store, hash-verified

87
88
89def points_to_polyline(points, x_min, x_max, y_max, plot):
90 left, top, width, height = plot
91
92 def project(point):
93 x, y = point
94 px = left + (x - x_min) / (x_max - x_min) * width
95 py = top + height - y / y_max * height
96 return f"{px:.2f},{py:.2f}"
97
98 return " ".join(project(point) for point in points)
99
100
101def render_svg(rows, title, width, height):

Callers 1

render_svgFunction · 0.85

Calls 1

projectFunction · 0.85

Tested by

no test coverage detected