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 namedvalues,x_centers, andy_centers.- Parameters:
- x, yarray_like or
xarray.DataArray Paired samples with identical shapes.
- gridsize“auto” or
intorpairofint, 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 asint(gridsize / sqrt(3)), giving approximately regular hexagons as inmatplotlib.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.
- axis
int, sequence ofintorNone, 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.
- dim
stror sequence ofstr, optional DataArray dimension or dimensions along which to reduce.
- x, yarray_like or
- Returns:
tupleorxarray.DatasetHexagon values and center coordinates.