Precipitates in a 3D matrix

I have something similar somewhere, here is a simple adaptation that could fit your need:

using CairoMakie
CairoMakie.activate!()

x, y, z = eachcol(rand(50, 3))

fig = Figure(size = (800, 600))
ax = Axis3(fig[1, 1],
	xlabel = "X",
	ylabel = "Y",
	zlabel = "Z",
	title = "3D Spheres with Lighting",
	aspect = :data,
	perspectiveness = 0.5f0,
	azimuth = π / 4,
	elevation = π / 6,
)

for (xi, yi, zi) in zip(x, y, z)
    sphere = Sphere(Point3f(xi, yi, zi), 0.05f0)
    mesh!(ax, sphere,
        color = :steelblue,
        shading = true,
        shininess = 32f0,
        diffuse = 0.8f0,
        specular = 0.4f0,
    )
end

display(fig)

I guess you could start with this and play with the different keywords and option to enhance the visual quality (Axis3 | Makie).

1 Like