seaborn.objects.Dash#

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

A line mark drawn as an oriented segment for each datapoint.

This mark defines the following properties:

color, alpha, linewidth, linestyle, |width|

Examples

A line segment is drawn for each datapoint, centered on the value along the orientation axis:

p = so.Plot(penguins, "species", "body_mass_g", color="sex")
p.add(so.Dash())
../_images/objects.Dash_1_0.png

A number of properties can be mapped or set directly:

p.add(so.Dash(alpha=.5), linewidth="flipper_length_mm")
../_images/objects.Dash_3_0.png

The mark has a width property, which is relative to the spacing between orientation values:

p.add(so.Dash(width=.5))
../_images/objects.Dash_5_0.png

When dodged, the width will automatically adapt:

p.add(so.Dash(), so.Dodge())
../_images/objects.Dash_7_0.png

This mark works well to show aggregate values when paired with a strip plot:

(
    p
    .add(so.Dash(), so.Agg(), so.Dodge())
    .add(so.Dots(), so.Dodge(), so.Jitter())
)
../_images/objects.Dash_9_0.png

When both coordinate variables are numeric, you can control the orientation explicitly:

(
    so.Plot(
        penguins["body_mass_g"],
        penguins["flipper_length_mm"].round(-1),
    )
    .add(so.Dash(), orient="y")
)
../_images/objects.Dash_11_0.png