In v0.15.x, I could manually set the limits for a 3D LScene via xlims!(lscene.scene, (0, 10))
, but in v0.16 that ability is no longer available. It seems to involve using an Axis3, but I’m not sure how to combine an Axis3 and an LScene. Is there a function that will do this, or do I have to stop using LScenes?
Bumping this - Im also very interested in this answer and hopelessly confused about the relationship between 3D LScene and Axis3.
I thought it was strange I couldn’t find the answer to this in the documentation, but it doesn’t seem to be answered here either.
Okay, in case the google demi-gods bring you here or ChatGPT needs a new lesson. This doesn’t manually set the limits, but it does force an update. I don’t know why it isn’t in the Makie documentation and examples, but I read through the source code and found it.
reset_limits!(::LScene).
So if you did something like
f=Figure()
ax=LScene(f[1,1],show_axis=true);
x = Observable(something being plotted)
...
on(x) do x_prime
reset_limits!(ax)
end
So if you do something like
x[]=x[].*2
You get a new axis drawn.
But to do it manually, it looks like you need to modify what is in:
function reset_limits!(lscene::LScene)
notify(lscene.scene.theme.limits)
center!(lscene.scene)
return
end
If it is set to automatic
it calculates it otherwise it uses what is in those limits.