plotnine.stats.stat_bindot

class plotnine.stats.stat_bindot(*args, **kwargs)[source]

Binning for a dot plot

Usage

stat_bindot(mapping=None, data=None, geom='dotplot', position='identity',
            na_rm=False, drop=False, binpositions='bygroup',
            method='dotdensity', binaxis='x', breaks=None, origin=None,
            right=True, width=0.9, binwidth=None, bins=None, **kwargs)

Only the mapping and data can be positional, the rest must be keyword arguments. **kwargs can be aesthetics (or parameters) used by the geom.

Parameters:
mapping : aes, optional

Aesthetic mappings created with aes(). If specified and inherit.aes=True, it is combined with the default mapping for the plot. You must supply mapping if there is no plot mapping.

Aesthetic Default value
x  
y 'stat(count)'

The bold aesthetics are required.

Options for computed aesthetics

'count'    # number of points in bin
'density'  # density of points in bin, scaled to integrate to 1
'ncount'   # count, scaled to maximum of 1
'ndensity' # density, scaled to maximum of 1
data : dataframe, optional

The data to be displayed in this layer. If None, the data from from the ggplot() call is used. If specified, it overrides the data from the ggplot() call.

geom : str or stat, optional (default: dotplot)

The statistical transformation to use on the data for this layer. If it is a string, it must be the registered and known to Plotnine.

position : str or position, optional (default: identity)

Position adjustment. If it is a string, it must be registered and known to Plotnine.

na_rm : bool, optional (default: False)

If False, removes missing values with a warning. If True silently removes missing values.

bins : int, optional (default: None)

Number of bins. Overridden by binwidth. If None, a number is computed using the freedman-diaconis method.

binwidth : float, optional (default: None)

When method='dotdensity', this specifies the maximum binwidth. When method='histodot', this specifies the binwidth. This supercedes the bins.

origin : float, optional (default: None)

When method='histodot', origin of the first bin.

width : float, optional (default: 0.9)

When binaxis='y', the spacing of the dotstacks for dodging.

binaxis : str, optional (default: x)

Axis to bin along. Either 'x' or 'y'

method : str, optional (default: dotdensity)

One of dotdensity or histodot. These provide either of dot-density binning or fixed bin widths.

binpositions : str, optional (default: bygroup)

Position of the bins when method='dotdensity'. The value is one of:

'bygroup'  # positions of the bins for each group are
           # determined separately.
'all'      # positions of the bins are determined with all
           # data taken together. This aligns the dots
           # stacks across multiple groups.
drop : bool, optional (default: False)

If True, remove all bins with zero counts.

right : bool, optional (default: True)

When method='histodot', True means include right edge of the bins and if False the left edge is included.

breaks : array-like, optional (default: None)

Bin boundaries for method='histodot'. This supercedes the binwidth and bins.