编辑代码


import matplotlib.pyplot as plt

lines = [   
    [(0, 0), (-5, -1)],   
    [(0, -1), (-5, -2), (-6, -4), (-5, -5)],    
    [(-5, -3), (-4, -5)],    
    [(-4, -3), (3, -5)],    
    [(-3, -3), (-2,-4), (-3, -6),(8, -7)],    
    [(-3, -7),(-8, -8)]
]

for line in lines:
    x_coords, y_coords = zip(*line)
    plt.plot(x_coords, y_coords)

plt.xlabel('X')
plt.ylabel('Y')
plt.grid(True)
plt.axis('equal')
python
import matplotlib.pyplot as plt

lines = [   
    [(0, 0), (-5, -1)],   
    [(0, -1), (-5, -2), (-6, -4), (-5, -5)],    
    [(-5, -3), (-4, -5)],    
    [(-4, -3), (3, -5)],    
    [(-3, -3), (-2,-4), (-3, -6),(8, -7)],    
    [(-3, -7),(-8, -8)]
]

for line in lines:
    x_coords, y_coords = zip(*line)
    plt.plot(x_coords, y_coords)

plt.xlabel('X')
plt.ylabel('Y')
plt.grid(True)
plt.axis('equal')
python
import matplotlib.pyplot as plt

lines = [   
    [(0, 0), (-5, -1)],   
    [(0, -1), (-5, -2), (-6, -4), (-5, -5)],    
    [(-5, -3), (-4, -5)],    
    [(-4, -3), (3, -5)],    
    [(-3, -3), (-2,-4), (-3, -6),(8, -7)],    
    [(-3, -7),(-8, -8)]
]

for line in lines:
    x_coords, y_coords = zip(*line)
    plt.plot(x_coords, y_coords)

plt.xlabel('X')
plt.ylabel('Y')
plt.grid(True)
plt.axis('equal')
plt.show()