9951 explained code solutions for 126 technologies


python-matplotlibHow to plot a horizontal line


import matplotlib.pyplot as plt
plt.axline([0,1], [1,1])
plt.show()ctrl + c
import matplotlib.pyplot as plt

loads Matplotlib module to use plotting capabilities

axline

draws a line based on 2 points

[0,1], [1,1]

2 points of horizontal line going through 1 on y axis

.show()

render chart in a separate window