Matplotlib Axes have the functions axhline and axvline for drawing horizontal or vertical lines at a given y or x coordinate (respectively) indepen
axhline
axvline
If the axes are in the range [0,1], it can be resolved in this way:
[0,1]
ident = [0.0, 1.0] plt.plot(ident,ident)