I have several arrays denoting x- and y-coordinates. What I would like to do is to determine the y-range for which none of the resulting lines overlap with one another. To illustrate what I mean I wrote the following code:
import numpy
import matplotlib.pyplot as plt
x1, y1 = numpy.array([1., 2., 3., 4., 5., 6.]), numpy.array([5., 6., 7., 8., 9., 10.5])
x2, y2 = numpy.array([1., 2., 3., 4., 5., 6.]), numpy.array([7., 4., 3., 2., 1., 0.])
x3, y3 = numpy.array([1., 2., 3., 4., 5., 6.]), numpy.array([0., 7.5, 8.5, 4., 3., 5.])
x4, y4 = numpy.array([1., 2., 3., 4., 5., 6.]), numpy.array([14., 17., 16., 20., 19., 18.])
x5, y5 = numpy.array([1., 2., 3., 4., 5., 6.]), numpy.array([20., 18., 16., 13.5, 16., 17.])
plt.figure()
plt.plot(x1, y1)
plt.plot(x2, y2)
plt.plot(x3, y3)
plt.plot(x4, y4)
plt.plot(x5, y5)
plt.axhline(10.5, color = "black", ls = "dashed")
plt.axhline(13.5, color = "black", ls = "dashed")
plt.xlim(1, 6)
plt.ylim(0, 20)
plt.show()
This code produces the following image:
In this example there are 5 sets of x and y data arrays. There is a certain range (indicated by the horizontal black dashed lines) for which none of the data arrays overlap with one another with respect to the y-axis.
How can I determine this region? I'm sorry I do not have any suggestions as how to tackle this problem as I do not even have any idea as to which search terms I should use in this situation.
Thank you very much!