-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
band3d_bessel.jl
27 lines (27 loc) · 1.05 KB
/
band3d_bessel.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
using GLMakie, LaTeXStrings, SpecialFunctions, Random
Random.seed!(13)
GLMakie.activate!()
set_theme!(theme_black())
fig = Figure(resolution = (1200,800))
ax = Axis3(fig; aspect = (1,0.5,0.5), azimuth = 10.42, elevation = 0.027,
perspectiveness=0.5)
x = 0:0.1:15
y = -1:0.1:7
horizontal = Point3f.(tuple.(15, y, 3exp.(-(y .-3).^2/3)))
for ν in 0:7
lines!(ax, x, x*0 .+ ν, besselj.(ν, x) .+ ν/3, linewidth = 2,
color = :grey90, label = latexstring("J_{$(ν)}(x)"))
band!(ax, Point3f.(tuple.(x, ν, ν/3)),
Point3f.(tuple.(x, ν, besselj.(ν, x) .+ ν/3)), color = 1:length(x),
colormap = :plasma)
text!(ax, latexstring("J_{$(ν)}(x)"), position = Point3f(15.2,ν, ν/3))
end
band!(ax, Point3f.(tuple.(0, y, 0.0)),
Point3f.(tuple.(0, y, 3exp.(-(y .-3).^2/3))), color = rand(length(y)))
band!(ax, horizontal[1:40], reverse(horizontal[42:end]); color = 1:40,
colormap = :bone_1)
lines!(ax, horizontal; color= :white, linewidth = 2)
hidedecorations!(ax; grid = false)
fig[1,1] = ax
save("band3d_bessel.png", fig)
display(fig)