from plotnine import ggplot, aes, labs, theme_classic, geom_point
from plotnine.data import mtcars
Classic
# Gallery, themes
(="wt", y="mpg", colour="factor(gear)"))
ggplot(mtcars, aes(x+ geom_point()
+ labs(
= "Fuel economy declines as weight increases",
title="(1973-74)",
subtitle="Data from the 1974 Motor Trend US magazine.",
caption="Weight (1000 lbs)",
x="Fuel economy (mpg)",
y="Gears"
colour
)+ theme_classic()
)