Makie xlims!

fig = lines(x, y, z, linewidth=0.5, show_axis=false)
xlims!(fig.axis.scene, 1.05,1.95)
ylims!(fig.axis.scene, 1.05,1.95)

Seems like an oversight bug that fig.axis which is a LScene doesn’t work with the limit functions. So, we need to get the underlying plain old Makie Scene.

If you are planning on doing layouts though, it might be better to use an explicit axis:

fig = Figure()
ax1 = fig[1, 1] = Axis(fig, ...)
lines!(ax1, x, y, z, linewidth=0.5, show_axis=false)
xlims!(ax1, 1.05, 1.95)
ylims!(ax1, 1.05, 1.95)
2 Likes