I'm trying out the new object API of seaborn. The API is introduced in version 0.12.
However, I have difficulty retrieving the underlying Matplotlib Axes/Figure object. For example, when using sns.lineplot, it returns a Matplotlib Axes object, and we can call the methods of the Axes afterwards, as in:
import seaborn as sns
tips = sns.load_dataset('tips')
y = sns.lineplot(data=tips, x='size', y='tip') # y is an Axes object
y.set_title("my title")
y
Is there any way that I can retrieve the Matplotlib object from the new object API, as in:
x = (
so.Plot(tips, "size", "tip")
.add(so.Line(), so.Agg())
)
type(x) # seaborn._core.plot.Plot, not Matplotlib