seaborn.objects.Shift#

class seaborn.objects.Shift(x=0, y=0)#

Displacement of all marks with the same magnitude / direction.

Parameters:
x, yfloat

Magnitude of shift, in data units, along each axis.

Examples

Use this transform to layer multiple marks that would otherwise overlap and be hard to interpret:

(
    so.Plot(penguins, "species", "body_mass_g")
    .add(so.Dots(), so.Jitter())
    .add(so.Range(), so.Perc([25, 75]), so.Shift(x=.2))
)
../_images/objects.Shift_1_0.png

For y variables with a nominal scale, bear in mind that the axis will be inverted and a positive shift will move downwards:

(
    so.Plot(diamonds, "carat", "clarity")
    .add(so.Dots(), so.Jitter())
    .add(so.Range(), so.Perc([25, 75]), so.Shift(y=.25))
)
../_images/objects.Shift_3_0.png