arviz_stats.hexbin

Contents

arviz_stats.hexbin#

arviz_stats.hexbin(x, y, gridsize='auto', extent=None, weights=None, axis=-1, density=True, regular=True, dim=None)[source]#

Compute a hexagonal histogram for paired samples.

Plain arrays return (values, offsets). DataArray inputs return a Dataset with variables named values, x_centers, and y_centers.

Parameters:
x, yarray_like or xarray.DataArray

Paired samples with identical shapes.

gridsize“auto” or int or pair of int, default “auto”

Number of hexagons in the x and y directions. "auto" applies the default two-dimensional bin rule to each marginal, reduced to shared counts over batched input. A scalar derives the y-direction size as int(gridsize / sqrt(3)), giving approximately regular hexagons as in matplotlib.pyplot.hexbin. A pair sets both directions explicitly.

extentarray_like, optional

Limits (xmin, xmax, ymin, ymax) of the hexagon grid.

weightsarray_like or xarray.DataArray, optional

Sample weights with the same shape as the samples. Values in each cell are the sum of its sample weights.

axisint, sequence of int or None, default -1

Array axis or axes along which to reduce.

densitybool, default True

Divide counts by the valid sample count and hexagon area.

regularbool, default True

Whether to use a regular hexagonal grid.

dimstr or sequence of str, optional

DataArray dimension or dimensions along which to reduce.

Returns:
tuple or xarray.Dataset

Hexagon values and center coordinates.