2026-01-12
Let’s get things set up:
and use the Palmer Penguins dataset
plotnine is basically a port of ggplot2 for python.
Have a look at the cheatsheet:
ggplot(
data,
aes(...)
) + geom_function()
or, with all the bells and whistles:
ggplot(data=data_frame)
+ geom_function(
mapping=aes(**mappings)
stat=stat,
position=position,
) + coord_function()
+ facet_function()
+ scale_function()
+ theme_function()
+ theme(**settings)
Here’s some summarized data from the YTS: