def avgMultiplePlots(data, calc_mean=True, calc_std=False,<EOL>calc_density=False, nsample=None):
xArr, yArr = bringPlotOverSameX(data, nsample)<EOL>out = [xArr]<EOL>if calc_mean:<EOL><INDENT>out.append(np.nanmean(yArr, axis=<NUM_LIT:0>))<EOL><DEDENT>if calc_std:<EOL><INDENT>out.append(np.nanstd(yArr, axis=<NUM_LIT:0>))<EOL><DEDENT>if calc_density:<EOL><INDENT>out.append(len(yArr) - np.isnan(yArr).sum(axis=<NUM_LIT:0>))<EOL><DEDENT>return tuple(out)<EOL>
return the average (x,y) for a set of multiple x,y arrays
which can have a different length and resolution

data = ((xvals,yvals),(),,,)
assumes that x values are sorted