xy2binned

edge_pydb.plotting.xy2binned(xarr, yarr, log=True, bins=20, range=None, yval='mean')[source]

Prepare binned averages from a scatterplot. If log=True, averaging is done after taking the log of x and y.

Parameters:
xarrnumpy.array

The x values in the scatter plot

yarrnumpy.array

The y values in the scatter plot

logboolean

If True, take the log of input x and y

binsint

The number of bins in x for the averaging

range(float, float)

The lower and upper range of the bins. If not provided, uses (x.min(), x.max())

yvalstring

‘mean’ (default) or ‘median’

Returns:
xbinnumpy.array

the centers (NOT edges) of the x bins

ymeannumpy.array

the binned y-values

ystdnumpy.array

standard deviation of y-values

ycntnumpy.array

number of y-values in each bin