Use axhline (a horizontal axis line). For example, this plots a horizontal line at y = 0.5:
import matplotlib.pyplot as plt
plt.axhline(y=0.5, color="r", linestyle="-")
plt.show()

Use axhline (a horizontal axis line). For example, this plots a horizontal line at y = 0.5:
import matplotlib.pyplot as plt
plt.axhline(y=0.5, color="r", linestyle="-")
plt.show()
