Say I have two lines, defined by the data
x1 = [0,1,2,3]
y1 = [3,5,4,6]
x2 = [1.5,2.5,3.5,4.5]
y2 = [1,3,2,4]
which make the plot
plt.figure(figsize=(10,10))
plt.plot(x1, y1)
plt.plot(x2, y2)
plt.show()
How can I fill between those two lines? I want the polygon made by connecting the endpoints of these lines, but plt.fill_between
and plt.fill_betweenx
don't work, as they are on both different x and y ranges.