seaborn.objects.Area#

class seaborn.objects.Area(artist_kws=<factory>, color=<'C0'>, alpha=<0.2>, fill=<True>, edgecolor=<depend:color>, edgealpha=<1>, edgewidth=<rc:patch.linewidth>, edgestyle=<'-'>, baseline=<0>)#

A fill mark drawn from a baseline to data values.

This mark defines the following properties:

color, alpha, fill, edgecolor, edgealpha, edgewidth, edgestyle, |baseline|

See also

Band

A fill mark representing an interval between values.

Examples

p = so.Plot(healthexp, "Year", "Spending_USD").facet("Country", wrap=3)
p.add(so.Area())
../_images/objects.Area_0_0.png

The color property sets both the edge and fill color:

p.add(so.Area(), color="Country")
../_images/objects.Area_2_0.png

It’s also possible to map only the edgecolor:

p.add(so.Area(color=".5", edgewidth=2), edgecolor="Country")
../_images/objects.Area_4_0.png

The mark is drawn as a polygon, but it can be combined with Line to draw a shaded region by setting edgewidth=0:

p.add(so.Area(edgewidth=0)).add(so.Line())
../_images/objects.Area_6_0.png

The layer’s orientation defines the axis that the mark fills from:

p.add(so.Area(), x="Spending_USD", y="Year", orient="y")
../_images/objects.Area_8_0.png

This mark can be stacked to show part-whole relationships:

(
    so.Plot(healthexp, "Year", "Spending_USD", color="Country")
    .add(so.Area(alpha=.7), so.Stack())
)
../_images/objects.Area_10_0.png