Faceted beeswarm

Based on an example from Observable Plot, this plot shows body mass of penguins across different species. Sex is encoded using color, and points are dodged to avoid overlap.

<Plot
    color={{ legend: true }}
    fx={{ axis: 'bottom' }}
    r={{ zero: false }}
    y={{ grid: true }}>
    <Dot
        data={penguins}
        fx="species"
        x={0}
        y="body_mass_g"
        fill="sex"
        dodgeX="middle" />
</Plot>

Open in Svelte playground

Improve this page
Last update at: 2025/11/24