seaborn.objects.Stack#
- class seaborn.objects.Stack#
Displacement of overlapping bar or area marks along the value axis.
Examples
This transform applies a vertical shift to eliminate overlap between marks with a baseline, such as
Bar
orArea
:so.Plot(titanic, x="class", color="sex").add(so.Bar(), so.Count(), so.Stack())
Stacking can make it much harder to compare values between groups that get shifted, but it can work well when depicting a part-whole relationship:
( so.Plot(titanic, x="age", alpha="alive") .facet("sex") .add(so.Bars(), so.Hist(binwidth=10), so.Stack()) )