代码
# -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
import numpy as np
def line(y1,x1,y2,x2,z):
x = [x1,x2]
y = [y1,y2]
plt.plot(x, y)
plt.text(x1,y1,z)
#设置范围
plt.xlim(0, 515)
plt.ylim(0, 448)
line1 = line(197, 286, 217, 310, 0)
line2 = line(209, 93, 229, 115, 0.4)
line3 = line(125, 82, 159, 272,0.8)
line4 = line(84, 304, 102, 332,1.2)
line5 = line(103,64, 120, 87,1.6)
line6 = line(29, 185, 51, 197,1)
plt.show()