plotnine.stat_bin_2d

stat_bin_2d(mapping=None, data=None, **kwargs)

2 Dimensional bin counts

{usage}

Parameters

bins : int = 30

Number of bins. Overridden by binwidth.

breaks : array_like | tuple[array_like, array_like] = None

Bin boundaries. This supersedes the binwidth, bins, center and boundary. It can be an array_like or a list of two array_likes to provide distinct breaks for the x and y axes.

binwidth : float = None

The width of the bins. The default is to use bins bins that cover the range of the data. You should always override this value, exploring multiple widths to find the best to illustrate the stories in your data.

drop : bool = False

If True, removes all cells with zero counts.

See Also

geom_rect

The default geom for this stat.