using WGLMakie
22 Makie
Basic plots using Makie.jl.
22.1 Boxplot
= randn(300);
x = randn(400) .+ 1.6;
y = randn(320) .- 2.2;
z = vcat(repeat([1], 300), repeat([2], 400), repeat([3], 320)); key
boxplot(key, vcat(x, y, z))
22.2 Density
density(x)
=[x, y, z]
dat= Figure()
f = Axis(f[1, 1])
ax for (i, v) in enumerate(dat)
density!(ax, v)
end
f
22.3 Histogram
hist(x)
= Figure()
f = Axis(f[1, 1])
ax for (i, vector) in enumerate(dat)
hist!(ax, vector)
end
f
22.4 Scatter
= randn(300);
x = 3 .+ x.^3 + randn(300);
y = 4 .+ x.^2 + randn(300); y2
scatter(x, y)
= [y, y2]
val = Figure()
f = Axis(f[1, 1])
ax for i in eachindex(val)
scatter!(x, val[i])
end
f
22.5 Barplot
= ["alpha", "beta", "gamma"];
x = [3, 9, 5];
y = [5, 8, 7]; y2
barplot(collect(eachindex(x)), y, bar_labels=x)
= hcat(y, y2);
val = reshape(collect(eachindex(val)), 2, 3);
xpos = Figure()
f = Axis(f[1, 1])
ax for i in 1:size(val)[2]
barplot!(xpos[i, :], val[:, i], bar_labels=x, width = 1)
end
f