Skip to content

Update Makie examples #80

Description

@ohno
using CairoMakie

# setting
f = Figure()
ax = Axis(f[1,1], xlabel=L"$x$", ylabel=L"$\psi(x)$")

# plot
w0 = lines!(ax, -5..5, x -> ψ(HO, x, n=0))
w1 = lines!(ax, -5..5, x -> ψ(HO, x, n=1))
w2 = lines!(ax, -5..5, x -> ψ(HO, x, n=2))
w3 = lines!(ax, -5..5, x -> ψ(HO, x, n=3))
w4 = lines!(ax, -5..5, x -> ψ(HO, x, n=4))

# legend
axislegend(ax, [w0, w1, w2, w3, w4], [L"n=0", L"n=1", L"n=2", L"n=3", L"n=4"], position=:lb)

f

to

using CairoMakie

# setting
fig = Figure()
axis = Axis(fig[1,1], xlabel=L"$x$", ylabel=L"$\psi(x)$")

# plot
lines!(axis, -5..5, x -> ψ(HO, x, n=0), label=L"n=0")
lines!(axis, -5..5, x -> ψ(HO, x, n=1), label=L"n=1")
lines!(axis, -5..5, x -> ψ(HO, x, n=2), label=L"n=2")
lines!(axis, -5..5, x -> ψ(HO, x, n=3), label=L"n=3")
lines!(axis, -5..5, x -> ψ(HO, x, n=4), label=L"n=4")

# legend
axislegend(axis, position=:lb, framevisible=false)

fig

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentation

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions