From f96134f5809cfb0495bc0124d1c5c9bde83f8b34 Mon Sep 17 00:00:00 2001 From: Anshul Singhvi Date: Sat, 9 Mar 2024 20:07:31 -0500 Subject: [PATCH] Better `introduction.md` --- docs/src/introduction.md | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/docs/src/introduction.md b/docs/src/introduction.md index cf2ccb1..586aa3a 100644 --- a/docs/src/introduction.md +++ b/docs/src/introduction.md @@ -18,8 +18,24 @@ Here's a quick example to get you started: using CairoMakie, SwarmMakie xs = rand(1:3, 40) ys = randn(40) -f, a, p = scatter(xs, ys; color = xs) -beeswarm(f[1, 2], xs, ys; color = xs, algorithm = NoBeeswarm()) +f, a, p = scatter(xs, ys; color = xs, axis = (; title = "Scatter plot")) +beeswarm(f[1, 2], xs, ys; color = xs, algorithm = SimpleBeeswarm(), axis = (; title = "Beeswarm plot")) f ``` +## Use with AlgebraOfGraphics.jl + +As a Makie recipe, `beeswarm` also composes with AlgebraOfGraphics! + +```@example aog +using AlgebraOfGraphics, CairoMakie, SwarmMakie +using RDatasets, DataFrames +iris = dataset("datasets", "iris") + +f = data(iris) * + mapping(:Species, :SepalLength; color = :Species) * + visual(Beeswarm) |> draw +Makie.update_state_before_display!(f.figure) +Makie.update_state_before_display!(f.figure) +f +``` \ No newline at end of file