(points, x_min, x_max, y_max, plot)
| 87 | |
| 88 | |
| 89 | def 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 | |
| 101 | def render_svg(rows, title, width, height): |