该行端点的坐标在轴坐标中为(0.5,0)和(0.5,1):
from matplotlib.lines import Line2Dfrom matplotlib import pyplotf=pyplot.figure()a=f.add_subplot(111)a.plot([3,1,4,1,5,9,2], color='k') # so you have some contenta.add_line(Line2D([0.5, 0.5], [0, 1], transform=a.transAxes, linewidth=2, color='b'))pyplot.show()



