I'm thinking this is extremely simple. I would like to graph the line y = 7.87. This graphs a line parallel to the y-axis, but I'm looking for something horizontal, parallel with x-axis. Any ideas?
import matplotlib.pyplot as plt
plt.axvline(x = 7.85)
plt.show()
It really is quite simple:
import matplotlib.pyplot as plt
plt.axhline(y=7.87)
plt.show()
The h and v in the function names (axhline and axvline) stand for horizontal and vertical.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With