Overview
Seaborn 0.12, released on August 11, 2022, introduces the Objects interface and new Plot API for more flexible chart construction.
Main Features
Objects interface
The Objects interface provides a declarative API inspired by ggplot2 for building charts through layer composition.
python
import seaborn.objects as so
from seaborn import load_dataset
tips = load_dataset('tips')
(
so.Plot(tips, x='total_bill', y='tip', color='day')
.add(so.Dot())
.add(so.Line(), so.PolyFit())
)
# .show()
New Plot API
The Plot API combines visual elements with statistical transformations in a modular and reusable way.
python
import seaborn.objects as so
from seaborn import load_dataset
penguins = load_dataset('penguins')
(
so.Plot(penguins, x='flipper_length_mm', y='body_mass_g')
.facet('species')
.add(so.Dot(alpha=0.5))
)
# .show()
