Skip to content

Instantly share code, notes, and snippets.

@jkrumbiegel
Created April 19, 2021 08:29
Show Gist options
  • Save jkrumbiegel/37594dbb14e0e108e31c82fdd224f988 to your computer and use it in GitHub Desktop.
Save jkrumbiegel/37594dbb14e0e108e31c82fdd224f988 to your computer and use it in GitHub Desktop.
measures = ["Endurance", "Coordination", "Speed", "Power Low", "Power Up"]
groups = ["boys", "girls"]
x = LinRange(-8, 9, 15)
f = Figure(resolution = (1000, 500))
axs = [Axis(f[1, i]) for i in 1:length(measures)]
for (i, m) in enumerate(measures)
Box(f[1, i, Top()], backgroundcolor = :gray)
Label(f[1, i, Top()], m, padding = (5, 5, 5, 5))
hlines!(axs[i], 0)
for (j, g) in enumerate(groups)
a, b = 2 * rand(), rand()
func(x) = a * x + b
data = func.(x) .+ 0.4 .* randn.()
lines!(axs[i], x, func)
scatter!(axs[i], x, data, color = [:black, :white][j], label = g)
end
end
axislegend(axs[1], position = :lt)
axs[3].xlabel = "Age"
hideydecorations!.(axs[2:end], grid = false)
linkaxes!(axs...)
colgap!(f.layout, 10)
f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment