seaborn.objects.Count#
- class seaborn.objects.Count#
Count distinct observations within groups.
See also
HistA more fully-featured transform including binning and/or normalization.
Examples
The transform counts distinct observations of the orientation variable defines a new variable on the opposite axis:
so.Plot(tips, x="day").add(so.Bar(), so.Count())
When additional mapping variables are defined, they are also used to define groups:
so.Plot(tips, x="day", color="sex").add(so.Bar(), so.Count(), so.Dodge())
Unlike
Hist, numeric data are not binned before counting:so.Plot(tips, x="size").add(so.Bar(), so.Count())
When the
yvariable is defined, the counts are assigned to thexvariable:so.Plot(tips, y="size").add(so.Bar(), so.Count())