Plotting with Python
You can use the
where option. As in the example you can do something like:
fill_between(x, myzero, y1, where=y2>=y1, facecolor='blue', interpolate=True)
Where y2 is the line that is sometimes on top. You will have do do this for each of the lines, though.
Another option is to define a minimum of the functions and fill below that, though you will either need to know before hand that the ys are defined at the same points or use interpolation so that they are all defined at the same points.
mymin = np.minimum(y1,y2,y3) fill_between(x, myzero, mymin)
Hope that helps.
Edit: To find the minimum from several functions which are all defined for the same x-values you can use the following:
def OverallMinimum(*ys): mymin = y.copy() for y in ys: min = np.minimum(mymin,y) return mymin
Then you can use the second
fill_between from above to plot between zero and the minimum from that function.