Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

horizontal line for pyplot

import matplotlib.pyplot as plt
import numpy as np

x = np.linspace(1, 21, 200)
y = np.exp(-x)

fig, ax = plt.subplots()
ax.plot(x, y)
ax.hlines(y=0.2, xmin=4, xmax=20, linewidth=2, color='r')

plt.show()
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #horizontal #line #pyplot
ADD COMMENT
Topic
Name
4+1 =