Skip to content

SwarmMakie.jl

Beeswarm plots for Makie.jl

SwarmMakie

What is SwarmMakie.jl?

SwarmMakie makes beeswarm plots for Makie through the beeswarm recipe. These are like categorical scatter plots that distribute points around the category lines so that there's less visual overlap and densities are easier to gauge.

Quick start

The beeswarm recipe accepts similar arguments to scatter.

julia
using SwarmMakie, CairoMakie

algorithms = [:default, :wilkinson, :none, :uniform, :pseudorandom, :quasirandom]
fig = Figure(; size = (800, 450))
xs = rand(1:3, 400); ys = randn(400)

for (i, algorithm) in enumerate(algorithms)
    beeswarm(
        fig[fldmod1(i, 3)...], xs, ys;
        color = xs, algorithm, markersize = 4,
        axis = (; title = repr(algorithm)),
    )
end

fig