seaborn.objects.Lines#

class seaborn.objects.Lines(artist_kws=<factory>, color=<'C0'>, alpha=<1>, linewidth=<rc:lines.linewidth>, linestyle=<rc:lines.linestyle>)#

A faster but less-flexible mark for drawing many lines.

This mark defines the following properties:

color, alpha, linewidth, linestyle

See also

Line

A mark connecting data points with sorting along the orientation axis.

Examples

Like Line, the mark draws a connecting line between sorted observations:

so.Plot(seaice, "Date", "Extent").add(so.Lines())
../_images/objects.Lines_1_0.png

Compared to Line, this mark offers fewer settable properties, but it can have better performance when drawing a large number of lines:

(
    so.Plot(
        x=seaice["Date"].dt.day_of_year,
        y=seaice["Extent"],
        color=seaice["Date"].dt.year
    )
    .facet(seaice["Date"].dt.year.round(-1))
    .add(so.Lines(linewidth=.5, color="#bbca"), col=None)
    .add(so.Lines(linewidth=1))
    .scale(color="ch:rot=-.2,light=.7")
    .layout(size=(8, 4))
    .label(title="{}s".format)
)
../_images/objects.Lines_3_0.png