How to get a Semi transparent sphere in Makie?

You can pass alpha = x and transparency = true when you call surface:

fig, ax, plt = surface(sx,sy,sz,color = fill(:red, n, n),invert_normals=true,alpha=0.5,transparency=true)
meshscatter!(ax, sx[1:10:end], sy[1:10:end], sz[1:10:end], color = :blue)
fig

or just add transparency=true if you pass the alpha value to the colour:

fig, ax, plt = surface(
  sx,sy,sz,
  color = fill((:red,0.5), n, n),invert_normals=true,transparency=true)
meshscatter!(ax, sx[1:10:end], sy[1:10:end], sz[1:10:end], color = :blue)
fig

image

1 Like