I'm trying to create a 'fill' graph in matplotlib from a pair of numpy arrays containing multiple 'curves' to be plotted. The numpy arrays have the form:
xarray([[ 0], #curve 1
[ 100], #curve 1
[ 200], #curve 1
[ 0], #curve 2
[ 100], #curve 2
[ 200]]) #curve 2
yarray([[ 11], #curve 1
[ 22], #curve 1
[ 22], #curve 1
[ 19], #curve 2
[ 12], #curve 2
[ 0]]) #curve 2
where for this example code there are two curves (i.e x = 0-200 twice). The actual arrays have ~300 curves all starting at x = 0, although I can number them (using another array containing curve numbers) if necessary. The number of points in each xy pair is also varies.
I want to plot them with an alpha value ~0.01 (i.e nearly transparent) so that the area under the most of the curves shows up the most coloured.
However, if I put the x and y arrays into the fill function (plt.fill(xarray, yarray, alpha=0.01)) it views all the data as a single curve, so the alpha values do not stack when the curve lies on top of itself.
I am unsure how to change the x and y arrays into a list of comma separated arrays that the plt.fill function will accept. Something so that the end result will be the equivalent of me manually writing:
plt.fill(x1, y1, x2, y2, ... yn, xn, alpha=0.01)
Any ideas?
Please let me know if I haven't explained any of that well enough. Thanks!
indices = np.array([0, 0, 0, 1, 1, 1])?