Violins collection
using CairoMakie, Distributions, Random
Random.seed!(124)
n = 4
colors = resample_cmap(:seaborn_colorblind, 8)
sides = [:left, :right, :right]
fig = Figure(resolution = (600,400))
ax = Axis(fig[1,1]; palette = (; patchcolor = colors))
for i in [-5,5], j in 1:n
violin!(fill(j, 1000), rand(Normal(i,rand()+0.5), 1000);
side = i >-3 ? sides[rand(1:3)] : :both)
end
violin!(fill(2.5, 1000), rand(Normal(0,2.5), 1000); color = :transparent,
strokewidth = 0.85, strokecolor = :grey10, show_median = true,
mediancolor = :black)
violin!(fill(4.5, 1000), rand(Normal(2,2), 1000); color = (:dodgerblue,0.1),
strokewidth = 0.85, strokecolor = :dodgerblue, show_median = true,
medianlinewidth = 3)
ax.xticks = (1:n, string.('A':'D'))
hideydecorations!(ax; grid = false)
fig
Warning
This example was autogenerated using:
using Pkg
Pkg.status(["CairoMakie", "Distributions"])
Status `~/work/BeautifulMakie/BeautifulMakie/docs/Project.toml`
[13f3f980] CairoMakie v0.10.6
[31c24e10] Distributions v0.25.96
This page was generated using Literate.jl.