1
0
Fork 0
mirror of https://gitlab.rlp.net/mobitar/ReCo.jl.git synced 2024-09-19 19:01:17 +00:00

Append to axis

This commit is contained in:
Mo 2022-05-01 12:35:36 +02:00
parent 3729bb1837
commit ae213143e5

View file

@ -11,14 +11,14 @@ function gen_elliptical_distance_graphics()
ax = Axis(fig[1, 1]; xlabel=L"x", ylabel=L"y") ax = Axis(fig[1, 1]; xlabel=L"x", ylabel=L"y")
elliptical_b_a_ratio = 0.4 elliptical_b_a_ratio = 0.4
as = 1:1:3 as = 1:3
for a in as for a in as
x = collect(LinRange(-a, a, 1000)) x = collect(LinRange(-a, a, 1000))
y = @. sqrt(a^2 - x^2) * elliptical_b_a_ratio y = @. sqrt(a^2 - x^2) * elliptical_b_a_ratio
append!(x, reverse(x)) append!(x, reverse(x))
append!(y, reverse(-y)) append!(y, reverse(-y))
lines!(x, y; label=L"a = %$a") lines!(ax, x, y; label=L"a = %$a")
end end
axislegend(ax; position=:rt, padding=3, rowgap=-3) axislegend(ax; position=:rt, padding=3, rowgap=-3)