from plotnine import (
ggplot,
aes,
geom_area,
geom_line,
scale_x_date,
scale_y_continuous,
theme_linedraw,
theme_set,
)from plotnine.data import economics
# Set default theme
theme_set(theme_linedraw())
Area Under Line
In [1]:
In [2]:
# Gallery, areas
(="date", y="unemploy"))
ggplot(economics, aes(x+ geom_line()
+ geom_area(fill="#e5c8d6", color="#9e2f68")
+ scale_x_date(expand=(0, 0), date_labels="%Y")
+ scale_y_continuous(expand=(0, 0, 0.1, 0))
+ theme_linedraw()
)