MakieOrg / Makie.jl

Interactive data visualizations and plotting in Julia
https://docs.makie.org/stable
MIT License
2.41k stars 311 forks source link

How to specify the location of the slice in volumeslices #2947

Open crazyfireji opened 1 year ago

crazyfireji commented 1 year ago

such as, I want to make the slices in the middle of the fig.

using GLMakie

fig = Figure()

ax = LScene(fig[1, 1], show_axis=false)

x = LinRange(0, π, 100)
y = LinRange(0, π, 200)
z = LinRange(0, π, 100)

vol = [cos(X)*sin(Y)*sin(Z) for X ∈ x, Y ∈ y, Z ∈ z]
plt = volumeslices!(ax, x, y, z, vol, bbox_visible = true)

fig

afa740ad7d72152

crazyfireji commented 1 year ago

And I also want to make the axis scale align with the box, and don't display the xgrid and ygrid.

asinghvi17 commented 1 year ago

[This example] shows how you can hook volumeslices up to a slider. As for the axis scale - you should look at the Axis3 docs!

Basically you can update the positions by plt[:update_yz][](v) where v is the value you want the slice to be at. It's not really documented, which we should fix...

ffreyer commented 2 months ago

You can change the location of the full plot by adjusting x, y, z or using translate and the docs show you a way to grab different planes. That leaves giving the option to make an LScene axis (or Axis3) tight to the volumeslices bbox.