Back to Article
Classic
Download Notebook

Classic

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