-
Notifications
You must be signed in to change notification settings - Fork 0
/
draw_lines.py
29 lines (22 loc) · 791 Bytes
/
draw_lines.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import matplotlib.pyplot as plt
# List of pairs of coordinates, where each pair is a line segment
# Each element is ((x1, y1), (x2, y2))
line_segments = [
((6850.000000, 11700.000000), (6665.000000, 11710.000000)),
((6665.000000, 11860.000000), (6775.000000, 11650.000000)),
]
# Create a plot
plt.figure(figsize=(8, 6))
# Plot each line segment
for segment in line_segments:
start_point, end_point = segment
x_values = [start_point[0], end_point[0]]
y_values = [start_point[1], end_point[1]]
plt.plot(x_values, y_values, marker='o', linestyle='-', markersize=5) # 'o' for circle markers
# Add titles and labels
plt.title('Line Segments')
plt.xlabel('X coordinate')
plt.ylabel('Y coordinate')
plt.grid(True) # Optionally add a grid
# Show the plot
plt.show()