plotnine.theme_bw

theme_bw(base_size=11, base_family=None)

White background with black gridlines

Parameters

base_size : int = 11

Base font size. All text sizes are a scaled versions of the base font size.

base_family : str = None

Base font family. If None, use plotnine.options.base_family.

Examples

from plotnine import ggplot, geom_point, aes, labs, theme_bw
from plotnine.data import mtcars

Black & White

# 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_bw()
)

Source: Black & White