Adding a plot triggers axis reset in Makie

If I have a makie plot

using GLMakie
fig = Figure()
ax = Axis(fig[1,1])
scatter!(ax, 10, 10)
fig

zoom and pan and then add another plot

scatter!(ax, 0, 0)

the view port is reset.

How can I prevent that?

the limits you get by zooming and panning are different limits than the ones you set explicitly with limits! or so, the interaction ones are overwritten by a new plot as the assumption is that you’d want to see what you’re adding. You can overwrite the explicit limits with the current limits I think, maybe with limits!(ax, ax.finallimits[]) and then the new plot shouldn’t touch those

Thanks for the hint. This worked for me:

limits = ax.finallimits[]
scatter!(ax, 0, 0)
limits!(ax, limits)